nginx 1.0.3 with php-fpm, php report 404 error

Edho P Arief edhoprima at
Fri May 27 07:43:04 MSD 2011

On Fri, May 27, 2011 at 10:26 AM, baalchina <baalchina at> wrote:
> Hi everyone
> I am using nginx 1.0.3 under CentOS 5.6, with php-fpm.
> nginx works fine with static file, such as html,txt. But not with php file.
> I wrote a phpinfo.php file in my webserver, my browser  and nginx log both
> report an 404 error.

did you set root parameter in location block (eg. location / { .. })
or in server block (server { ... })? You must set it in server block
if you want the location php to use the root or else it'll use default
root. Checking error log could also show you where nginx tried to find
the file.

More information about the nginx mailing list