thinkphp5 nginx配置 安全pathinfo版本
2017-11-15 10:36
507 查看
server { listen 80; server_name tp.com www.tp.com; index index.html index.htm index.php; root /home/wwwroot/thinkphp/public/; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; break; } } location ~ ^(.+\.php)(.*)$ { # try_files $uri =404; fastcgi_pass unix:/tmp/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; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { if (!-e $request_filename) { rewrite ^/(uploads/.*)$ /pic.php?$1 last; } expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } }
相关文章推荐
- 谈谈Nginx配置pathinfo对ThinkPHP5的支持
- nginx 部署thinkphp 做的东西, 配置 Pathinfo 模式,终于配好了
- 谈谈Nginx配置pathinfo对ThinkPHP5的支持
- thinkphp 下 nginx配置, 支持 pathinfo
- 在nginx中配置pathinfo模式支持thinkphp的URL重写
- 配置Nginx支持ThinkPHP的URL重写和PATHINFO
- nginx配置使其支持thinkphp的pathinfo模式
- thinkphp在低版本Nginx 下支持PATHINFO的方法分享
- windows下配置nginx pathinfo模式,支持thinkphp
- Nginx不支持ThinkPHP配置PATHINFO
- CentOS7.3系统Nginx-1.6.3、PHP-5.3.28配置支持ThinkPHP的URL重写和PATHINFO
- nginx 配置支持 thinkphp pathinfo
- thinkphp在低版本Nginx 下支持PATHINFO的方法分享
- LNMP 配置NGINX 支持THINKPHP PATHINFO模式
- ThinkPHP->pathinfo模式(Linux下nginx的配置说明)
- nginx 配置https(可支持thinkphp的pathinfo模式)
- Nginx下配置pathinfo及ThinkPHP的URL Rewrite模式支持
- ThinkPHP5 Nginx下的配置——支持pathinfo访问和隐藏入口文件index.php的rewrite规则
- LNMP 配置NGINX 支持THINKPHP PATHINFO模式
- LNMP 配置NGINX 支持THINKPHP PATHINFO模式