1,pathInfo 路径
- 支持ThinkPHP pathInfo路径 注释include enable-php.conf; 添加include enable-php-pathinfo.conf;
- 'url_model'=> '1', //URL模式 即pathinfo cgi.fix_pathinfo=0 改成cgi.fix_pathinfo=1
- 设置访问文件夹列表,注释后怎为 403 forbidden
server
{
listen 8080;
#listen [::]:80;
server_name 139.196.137.253 ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.freeenjoy.com;
include other.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
#支持ThinkPHP pathInfo路径 注释include enable-php.conf; 添加include enable-php-pathinfo.conf;
#include enable-php.conf;
include enable-php-pathinfo.conf;
#设置访问文件夹列表,注释后怎为 403 forbidden
location ~ /*
{
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ [^/]\.php(/|$)
{
#try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}
access_log /home/wwwlogs/www.freeenjoy.com.log;
}
2,隐藏端口号
server {
listen 80;
server_name www.up.com;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:1031;
}
}
proxy_set_header Host $proxy_host;
参考1
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。