IP-based HTTP auth

Reinis Rozitis r at roze.lv
Thu Sep 18 01:21:02 MSD 2008


> Auth does not work in the scope of if, what else can I do? Thanks.


You are missing 'satisfy  any;'
Try this:

location / {
  satisfy  any;

  allow 192.1.1.1;
  auth_basic            "Restricted";
  auth_basic_user_file  /usr/local/nginx/conf/htpasswd;

   deny   all;
}

--
rr






More information about the nginx mailing list