工单系统

绑定独立域名Nginx配置说明

2019-11-29 热度:3590,编辑:

1) 配置说明:支持Pathinfo,让您的URL更友好,原:http://www.xxx.com/index.php?c=c&m=m&ac=a,可以优化为:http://www.xxx.com/m/c/a

2) 具体配置(复制粘贴即可):

Server {
…
location ~ .php($|/) {
#nginx support path_info
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+.php)(/.+)") {
set $script $1;
set $path_info $2;
}
#Pass the PHPscripts to FastCGI server listening on 127.0.0.1:9000
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
…
}
  1. 配置说明:支持短路径配置,原链接:http://www.xxx.com/index.php/aboutus,可以优化为:http://www.xxx.com/aboutus

  2. 具体配置:

Server {
…
location / {
index index.php index.html index.htm;
rewrite ^/$ /index.php last;
rewrite ^/(?!index.php|.*.txt|.*.html|.*.htm|.*.swf|static|runtime|vendor)(.*)$ /index.php/$1 last;
}
…
}

注意:配置修改完后,请重启您的WEB服务器!URL的优化可让您的网站更易被搜索引擎收录,同时对用户也越加友好,强烈建议您使用。

3b2adfe150ef62d2b18b0a61cba01444_615x335.png

申明:本网站部分文章和图片来源网络编辑,如有侵权及时沟通删除。 来自 “ 点单星门店数字化解决方案_扫码点餐_收银系统_微信外卖系统_营销拓客系统软件 ” 网站原创文章,如需转载,请注明出处,否则将追究法律责任。 本页链接:https://www.ddx.red/feedback?id=3506
 
© 2015-2024 点单星®