访问 CentOS69 服务器 Laravel 项目失败,nginx 配置问题吗?

ESC云服务器安装centos6.9,配置了PHP环境,
直接访问域名 例如 www.blog.com 是可以看到laravel的welcome页,
安装laravel-admin后,访问www.blog.com/admin 就提示

File not found.

是因为nginx没配置好吗?麻烦看下我的配置,哪里有问题,谢谢。

以下是位于 centos6.9 /etc/nginx/conf.d/virtual.conf 的配置

server {

    listen       80 default_server;
    #listen       [::]:80 default_server;
    server_name  www.blog.com;
    root         /usr/share/nginx/html/blog/public;
    #root         /usr/share/nginx/html;

    location / {
        try_files $uri /app.php$is_args$args;
        rewrite ^/$ /index.php last;
        rewrite ^/(?!index\.php|robots\.txt|static)(.*)$ /index.php/$1 last;
        index  index.html index.htm index.php app.php;
    }

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

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        #fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        #fastcgi_param DOCUMENT_ROOT $realpath_root;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
最佳答案
location / {
    }

这段修改成

 location / {
        index index.php index.html index.htm;
        autoindex on;
        try_files $uri $uri/ /index.php?$query_string;
    }
5年前 评论
讨论数量: 1
location / {
    }

这段修改成

 location / {
        index index.php index.html index.htm;
        autoindex on;
        try_files $uri $uri/ /index.php?$query_string;
    }
5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!