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 ...
随机推荐
- Maximum Sum Circular Subarray LT918
Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty ...
- oracle primary key & foreign key
主键:一个表中只有一个主键约束,但是一个主键约束可以由数据表中的多个列组成:primary key alter table TName add constraints pk_name PRIMARY ...
- Spring Ioc 常用注解
在开发中spring ioc的配置方式有多种方式,常用的一般都是byName.byType .以及其自动装配可以查看http://www.cnblogs.com/gubai/p/9140840.htm ...
- org.apache.commons.httpclient工具类
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler; import org.apache.commons.httpcl ...
- 20155312 张竞予 Exp7 网络欺诈防范
Exp7 网络欺诈防范 目录 基础问题回答 (1)通常在什么场景下容易受到DNS spoof攻击 (2)在日常生活工作中如何防范以上两攻击方法 实验总结与体会 实践过程记录 (1)简单应用SET工具建 ...
- gitlab的安装和基本使用
一.gitlab的安装 1)安装依赖包 sudo yum install git vim gcc glibc-statc telnet -y sudo yum install -y curl poli ...
- 20175316盛茂淞 2018-2019-2 《Java程序设计》第6周学习总结
20175316盛茂淞 2018-2019-2 <Java程序设计>第6周学习总结 教材学习内容总结 第7章 内部类与异常类 1.使用 try.catch Java中所有信息都会被打包为对 ...
- linux下PythonQt混编记录
看了很多博主经验,然后自己实验总结出来的,就不一一写出处了,非常感谢各位博主的分享经验. 一.安装Python3.6 安装依赖环境 # yum -y install zlib-devel bzip2- ...
- 1013. Battle Over Cities 用dfs计算联通分量
使用一个标记数组,标记 节点是否已访问 int 连通度=0 dfs(node i) {标记当前节点为以访问 for(每一个节点) {if(当前几点未访问 并且 从i到当前节点有直接路径) dfs(当前 ...
- 浮点数运算结果不精确,以及用String来构造BigDecimal进行浮点数精确计算
1.浮点数运算结果不精确 先看如下代码 System.out.println(1.0 - 0.8); System.out.println(0.2 + 0.1); System.out.println ...