Laravel5.5在nginx訪問自定義路由返回404錯誤:php
nginx解決辦法:html
在location /裏面加上 try_files $uri $uri/ /index.php?$query_string;nginx
若是配置文件中存在 try_files $uri $uri/ =404;須要將它註釋掉或者刪掉,不然會報錯laravel
location /{
root /root/laravel_test/public;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}rest
重啓nginx:htm
systemctl restart nginx路由
訪問:http://192.168.1.172/welcomestring