Setting Allow / Deny Rules + Keep processing other location rules?

Mayhem30 nginx-forum at
Sat Jul 5 16:29:18 UTC 2014

I'm having a heck of a time setting allow / deny rules for certain
directories and files + getting Nginx to keep handling other location

For example, I want to only allow my IP address access to the WordPress
login page:

 location ~* wp-login.php {
      deny all;

 # Pass off php requests to Apache
 location ~* \.php$ {           
       include /usr/local/etc/nginx/proxypass.conf;

When I visit the WordPress login page, all I see is the raw PHP code.

How can I set up the first location block to allow me to add allow / deny
rules, charset, headers, etc + have PHP files still processed by the second
location block?

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

More information about the nginx mailing list