IP-based HTTP auth

Shamsundar Dileep lists at ruby-forum.com
Thu Sep 18 01:01:26 MSD 2008

Hello, I'm trying to implement HTTP auth, but want to limit it by IP.
That is, users originating from our office IP should not have to enter a
password, but everyone else should. I tried the following but with no

limit_except GET {
  auth_basic            "Restricted";
  auth_basic_user_file  /usr/local/nginx/conf/htpasswd;
  deny all;

Auth does not work in the scope of if, what else can I do? Thanks.
Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list