Allow directive with variables

Mayhem30 nginx-forum at nginx.us
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 :

allow 11.22.33.44
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: http://forum.nginx.org/read.php?2,234600,257423#msg-257423



More information about the nginx mailing list