访问 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;
    }
}
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
最佳答案
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年前 评论

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