Laravel5.5在nginx访问自定义路由返回404错误

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

相关文章
相关标签/搜索