nginx thinkphp伪静态配置,重写url不正确,求解答
环境:
nginx:nginx/1.18.0
php: 5.6.40
centos 6.5 linux 内核 2.6.32-431.el6.x86_64
nginx thinkphp伪静态配置,重写url不正确(旧项目用地thinkPHP3.2.3和新的thinkPHP5.1)
nginx配置:
server {
listen 8082;
server_name xxx.xxx.xxx.xxx;
location / {
root /usr/share/nginx/xxx;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
proxy_read_timeout 600;
proxy_ignore_client_abort on;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php {
root /usr/share/nginx/xxx;
fastcgi_read_timeout 600;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
client_max_body_size 8M;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论