Allow directive with variables

Mayhem30 nginx-forum at
Thu Mar 19 04:31:17 UTC 2015

An easy way to solve this issue is to create a "allowmyip.conf" file and
include it anywhere you wish.

allowmyip.conf file :

deny all;

Then in your server block :location ^~ /apc/ {
    # Allow home

    include /etc/nginx/allowmyip.conf;

This way it will be real easy to manage if your IP address changes. Just
update your IP Address in the allowmyip.conf file and restart the server.

Posted at Nginx Forum:,234600,257423#msg-257423

More information about the nginx mailing list