thinkphp5关于nginx的配置

浏览:3686 发布日期:2017/09/01 分类:求助交流
我的项目是放在 /httpd/nginx/html里,配置文件是这样写的:

server {
listen 80;
server_name localhost;
root /httpd/nginx/html/xxx/public;

location / {
try_files $uri @rewrite;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location @rewrite {
set $static 0;
if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
set $static 1;
}
if ($static = 0) {
rewrite ^/(.*)$ /index.php?s=/$1;
}
}

location ~ \.php/ {
if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { }
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param script_NAME $1;
fastcgi_param PATH_INFO $2;
fastcgi_param script_FILENAME $document_root$1;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param script_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

我访问其它模块都可以,比如http://域名/admin,但是我访问前台模块(默认的index)就报错了,如下:
/httpd/nginx/html/xxx/public/../application/index/view/Index/index.html

请问为什么会多出来 /.../的部分?
最佳答案
评论( 相关
后面还有条评论,点击查看>>