macos - Virtual host configuration problem of nginx under mac
伊谢尔伦
伊谢尔伦 2017-05-16 17:18:43
0
1
637

1. Configure ngnix virtual host on mac. The core configuration is as follows:

listen       8888;
    server_name xxxx.com;
    root  /Users/yangbai/Desktop/xxx;
    index  index.php;
    location / {
}


location ~ \.php$ {
        #root           /Users/yangbai/Desktop/xxx;
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #fastcgi_buffer_size 128k;
        #fastcgi_buffers 8 128k;
        fastcgi_ignore_client_abort on;

        include        fastcgi_params;
   }

After configuration, "File not found" appears. . . . The files and everything exist and the permissions are there. . .
Finally, I didn’t change the directory for a long time. I changed root /Users/yangbai/Desktop/xxx; to root /Library/WebServer/Documents/xxx; and moved the website to It can be accessed under the default webserver directory of mac. It seems that it is a permission issue under mac. I wonder if you have encountered it before?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
伊谢尔伦

This is owned by the user you ngnix的运行用户以及你当前用户的权限有关。你看到的文件夹的权限是你当前用户的,并不代表ngnixrun. If there are no other security considerations, you can change the permissions of the directory where the program is located to 777, which will save a lot of trouble.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template