How to setup nginx to make php works in site subdirectories

Francis Daly francis at daoine.org
Sun Feb 12 12:59:35 UTC 2012


On Sun, Feb 12, 2012 at 06:33:09AM -0500, dimentiy wrote:

Hi there,

> Scripts in site's root are processed, but in subdirectories are not (

Using your configuration, I'm unable to reproduce your reported output.

There are some tidy-up fixes that could be done to your configuration,
but what you have should be working already.

I suspect that either it *is* working but your browser cache is hiding
that from you; or you have an extra location{} block that means that your
"\.php$" one isn't being used.

Suggestion: create a file /var/www/nginx-default/example.com/stuff/new.php
with the contents:

==
<?php
print_r($_GET);
?>
stuff/new.php
==

and look at the result of getting example.com/stuff/new.php. That should
remove the "browser cache" possibility.

If it is still not what you expect, then something like the debug log
should show you which location{} is being used for this request.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list