allow access on a sublocation

Reinis Rozitis r at
Tue Aug 6 15:22:55 UTC 2013

Document sans nom> True, but I can't do that as "location / {}" is in a 
common config included by many other vhosts.

Then to clarify - you want to deny the access to all the "other vhosts" or 
just one?

If one - per you can leave 
the current config for all the "other vhosts" but define the one specific 
host you want to deny the access with exact server_name or if you use 
regular expression in the server_name place it as first in the main config.

If its all vhosts then just modify the included common config.

But in general it is hard to give you configuration suggestions not knowing 
how is your existing setup.

Typically vhosts (at least for me) each have their own server {} block so 
each one can have its own location definitions but the common parts (like 
*.php) can be included.


More information about the nginx mailing list