Single php file location match

drewrockshard nginx-forum at
Fri Mar 5 07:34:19 MSK 2010

How would I go about running a PHP file that is only matched by the request of that file?  Meaning, how can someone request a file and nginx run this configuration ONLY when this PHP file is requested.

Here is what I have so far:

location / {
            root   /www/default/;
            try_files $uri $uri/ /index.php?q=$uri&$args;
            index  index.php;

location /status.php {
            deny all;
            #allow all;
            root   /www/default/;
            try_files $uri $uri/ /index.php?q=$uri&$args;
            index status.php;

Basically, I'll be setting up rules to only allow a local network request, but only for status.php.  So how do I go about allowing this one network to status.php?

Posted at Nginx Forum:,60179,60179#msg-60179

More information about the nginx mailing list