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 ...
随机推荐
- window下mongodb的安装和环境搭建
一.下载安装包或者压缩包 1.下载 mongodb官网社区版下载页面 开发者一般使用社区版即可 3.6.3版本仅支持64位版本 2.安装 mongo compass是一个图形界面管理工具,安装过程非常 ...
- 一、selenium 环境搭建
本教程演示是在window系统上演示,linux.mac 系统以后会更新. 1.准备工作 1.python2或者python3安装包,官网:https://www.python.org/downloa ...
- HTML5-盒子的使用
一. border-color border-width border-style 属性用法遵循顺时针顺序. border-top- border-left- border-bottom- borde ...
- python 数据可视化 -- 生成可控的随机数据集合
生成可控的随机数据集合 使用 numpy.random 模块 numpy.random.random(size=None) 返回 [0.0, 1.0) 区间的随机 floats, 默认返回一个 fl ...
- ORACLE窗口函数
--ORACLE窗口函数,是针对分析用的. --create tablecreate table EMP ( empno NUMBER(4) not null, ename VARCHAR2(10), ...
- 优雅的找出ArrayList中重复的元素
https://blog.csdn.net/caoxiaohong1005/article/details/54286384
- 使用signalr实现网页和微信公众号实时聊天(上)
最近项目中需要实现客户在公众号中和客服(客服使用后台网站系统)进行实时聊天的功能.折腾了一段时间,实现了这个功能.现在将过程记录下,以便有相同需求的同行可以参考,也是自己做个总结.这篇是上,用手机编辑 ...
- SAS 循环与数组
SAS 循环与数组 SAS提供了循环语句以满足在编程中需要多次执行相同操作的情 况.有时还需要对不同的变量执行相同的操作,此时可定义SAS数组,并通过数组名和下标来引用这些变量. 1 循环 SAS循环 ...
- VS2015配置OpenCV,使用mfc摄像头程序测试
转自:https://blog.csdn.net/Lee_Dk/article/details/80466523 这只是介绍了如何加入OpenCV,怎么查找OpenCV请看出处. 新建一个项目.找到属 ...
- [转]BSD系统正在死亡?一些安全研究人员这样认为
摘要:在代码安全上被关注太少,漏洞没有被报告修补,FreeBSD.OpenBSD和NetBSD还能活下来吗? 在德国莱比齐的34c3网站上,IOActive的渗透测试主管Ilja von Sprund ...