Nginx错误404至所有laravel项目或某些

Nginx错误404至所有laravel项目或某些,nginx,Nginx,目前,我正在开发laravel项目并为web服务器安装brew nginx, 但不知何故,当我打开laravel项目时,它出现了404错误 所以我想看看发生了什么 tail-f/usr/local/var/log/nginx/error.log Output : the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local

目前,我正在开发laravel项目并为web服务器安装brew nginx, 但不知何故,当我打开laravel项目时,它出现了404错误

所以我想看看发生了什么

tail-f/usr/local/var/log/nginx/error.log

    Output : the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:1<br>

    *1 directory index of "/Users/user/Projects/new-project/" is forbidden, client: 127.0.0.1


根据nginx的Laravel文档,Im使用macbook unix终端catalina

根文件夹必须指向项目的公共目录
/path/to/project/public

遵循这个指南


也检查这个线程

让人觉得奇怪的是,一些项目可以打开一些无法打开的,所有这些都使用我上面使用的相同格式,并重新检查您提到的几次路径,这是我当前使用的实际路径

    user    www-data;
    worker_processes  1;
    events {
        worker_connections  1024;
    }

    server {
        listen       8080;
        server_name  test.localhost;

        location / {
            root   /Users/user/Projects/test;
            index  index.php;
        }

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

        location ~ \.php$ {
            root           /Users/user/Projects/test;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }