关于Laravel解析路径的问题

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

慕丝7291255
浏览 551回答 1
1回答

潇潇雨雨

应该是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;     } }
打开App,查看更多内容
随时随地看视频慕课网APP