Nginx: Allow $IP(s), HTTP authentication for others

Posted on Sun 07 September 2014 in Software • Tagged with nginx, linux, configuration, system-adminLeave a comment

Lets say you wanted to auth any HTTP connections outside your local lan. You can totally do that with nginx. Here's the configuration bit that does it:

satisfy any;

allow 192.168.1.0/24;
deny all;

auth_basic "Restricted";
auth_basic_user_file htpasswd;

I just saved that as …

Continue reading