nginx配置tp5的pathinfo模式并隐藏后台入口文件
server {
listen 2223;
server_name manage;
access_log /data/wwwlogs/access_manage.log combined;
root /data/wwwroot/webroot/manage/public;
index index.html index.htm admin.php;#默认后台admin.php
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /admin.php$1 last; #隐藏后台入口文件admin.php
break;
}
}
location ~ ^(.+\.php)(.*)$ {
# try_files $uri =404;
fastcgi_pass unix:/dev/shm/php-cgi.sock; #注意:不同系统,路由不一样
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(\/?.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
# 强制将某些非法地址交给 index.php 处理
set $new_fastcgi_script_name $fastcgi_script_name;
if (!-e $document_root$fastcgi_script_name) {
set $new_fastcgi_script_name "/index.php";
}
fastcgi_param SCRIPT_FILENAME $document_root$new_fastcgi_script_name;
fastcgi_param SCRIPT_NAME $new_fastcgi_script_name;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
if (!-e $request_filename) {
rewrite ^/(uploads/.*)$ /pic.php?$1 last;
}
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 7d; # 缓存7天
}
location ~ /\.ht
{
deny all;
}
}
nginx配置tp5的pathinfo模式并隐藏后台入口文件的更多相关文章
- nginx完美支持thinkphp3.2.2(需配置URL_MODEL=>1 pathinfo模式)
来源:http://www.thinkphp.cn/topic/26657.html 第一步:配置SERVER块 server { listen 80; server_name www.domain. ...
- Nginx兼容框架的pathinfo模式与URL重写
几乎所有的框架(ThinkPHP,Zend Framework,CI,Yii,laravel等)都会使用URL重写或者pathinfo模式,使URL看起来更美观,比如可以隐藏掉入口文件,并且有利于搜索 ...
- centos7 nginx完整支持thinkphp pathinfo模式开启方法
thinkphp运行在linux+nginx,如何开启pathinfo模式,我是完整测试过了,没问题的,在thinkphp配置文件 开启 'URL_MODEL' => 1, 1代 ...
- nginx 配置Tp5项目时出现 404 Not Found nginx
1.首先看了nginx报错日志 报 signal process started signal process started表示还有 产生原因 1.可能你的nginx.conf 内容配置的有问题. ...
- lnmp 一键安装包 nginx配置tp5 phpinfo模式 隐藏index.php
tp5 url 线上访问 在nginx 上 出现404错误 那是因为pathinfo没有被支持 修改如下:找到 /usr/local/nginx/config/vhost/项目名.config s ...
- linux服务器上的php代码通过nginx发布,解决pathinfo模式问题
附件1为修改前的正常访问php配置文件 附件2为修改后的能通过url地址访问php项目的配置文件 具体操作网址 如下:www.itokit.com/2012/0308/73275.ht ...
- THINKPHP nginx设置路由为PATHINFO模式
首先THINKPHP配置文件中设置 //url访问模式为rewrite模式 'URL_MODEL'=>'2', 然后再在nginx.conf文件中,找到这一条语句 #access_log log ...
- nginx 配置虚拟机 支持pathinfo
server { server_name shopx.local *.shopx.local; charset utf-8; root /Users/x/www/php/shopx.local/sho ...
- nginx支持pathinfo模式
很久不使用apache了,渐渐对apache感到陌生,因为朋友有个ZendFramework框架从apache移到nginx下,需要pathinfo模式支持.网上海搜于是开始搜索nginx+pathi ...
随机推荐
- 构造一个String类
#include "stdafx.h" #include<iostream> #include<string.h> using namespace std; ...
- The Swap
源程序 swap.cpp* 输入文件 swap.in 输出文件 swap.out 时间限制 1s 空间限制 256MB [问题描述] Alice 得到了一个整数, 她将其视作长度为 n 的字符串 S. ...
- View操作 swift
//创建View let view1 =UIView() let view2 =UIView(frame: CGRectMake(,, ,)) let view3 =UIView(frame: CGR ...
- EasyPR源码剖析(9):字符识别
在上一篇文章的介绍中,我们已经通过相应的字符分割方法,将车牌区域进行分割,得到7个分割字符图块,接下来要做的就是将字符图块放入训练好的神经网络模型,通过模型来预测每个图块所表示的具体字符.神经网络的介 ...
- GUI学习之九——QLineEdit的学习总结
我们在前面学习了各种按钮控件,从这一章开始就是各种输入控件的学习. 首先要用的就是QLineEdit——单行编辑器, 一描述 QLineEdit是一个单行文本编辑器,允许用户输入和编辑单行纯文本.自带 ...
- Android学习(二)
学号 20189214 <Android程序设计>第七周学习总结 教材学习内容总结 监听 设置点击监听的5种方式 方法1:直接用匿名内部类 这是最常用的一种方法,直接setXXXListe ...
- odoo8 元素简介
一:模型module: 1. 字段类型 (1)可控字段: fileds.char() fileds.Boolean() fileds.Date() (2)保留字段:(系统自动生成) id (Id) t ...
- System.Web.Caching.Cache缓存帮助类
/// <summary> /// 缓存帮助类 /// </summary> public class CacheHelper { /// <summary> // ...
- 项目管理 - PM、 SRS、SOW简介及范例
PM在一个IT项目中的主要管理任务 http://blog.csdn.net/eaglezhang/article/details/1717171 计算机软件需求说明编制指南 http://blog. ...
- Promise注意点
一. Promise API 概述 var p = new Promise( function(resolve,reject){ // resolve(..) 用于决议 / 完成这个 promise ...