Nginx itself cannot handle PHP, it is just a Web server. When a client request is received, if it is a PHP request, it is forwarded to the PHP interpreter for processing and returns the result to the client. If it is a static page, Nginx handles it itself and returns the result to the client.
The most used PHP interpreter under Nginx is fastcgi. In general, the PHP request forwarded to the FASTCGI management process processing, the FASTCGI management process to select the CGI sub-process processing, and then return the processing results to nginx.
In this process involves two users, one is nginx running user , one is php-fpm running user . If you are accessing a static file, you only need the user who is running nginx to have read or write access to the file.
And if the access is a PHP file, you first need to run the user to the file has Read permissions, read to the file after the discovery is a PHP file, then forwarded to PHP-FPM, at this time you need to PHP-FPM users have read access to the file or read and write permissions.
In General, the owner and owning group of Nginx running user, php-fpm running user, and Web root should be consistent.
I use the WWW user myself.
650) this.width=650; "src=" Http://static.oschina.net/uploads/space/2014/1010/143343_PFwT_727880.png "alt=" 143343_ Pfwt_727880.png "/>
This article is from the "Guilt Free" blog, so be sure to keep this source http://perofu.blog.51cto.com/6061242/1562165
Nginx and PHP-FPM User Rights description