咨询一个Laravel解析的问题,或者说是Nginx解析路径的问题。首先说一下问题的来源,由于最近在做一款基于laravel的目录索引程序,其中一个需求展示php结尾的文件,比如。https://dev.ningkai.wang/show... 这里我用了rewrite nginx默认解析了reward.php. 没有走larave 路由所以导致报错,如果不加rewrite应该是 https://dev.ningkai.wang/inde...
1 回答

潇潇雨雨
TA贡献1833条经验 获得超4个赞
应该是nginx配置不对,试试这个:
location / { try_files $uri $uri/ /index.php?$query_string; }
或者直接指定fastcgi_index试试
server { listen 80; server_name ******; set $local_index "/data1/www/laravel5/index.php"; location / { fastcgi_pass php-fpm; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $local_index; include fastcgi_params; fastcgi_keep_conn on; } error_page 500 502 503 504 /500.html; location = /500.html { root /data1/www/other/www; } }
- 1 回答
- 0 关注
- 550 浏览
添加回答
举报
0/150
提交
取消