Welcome! Log In Create A New Profile

Advanced

Re: combine basic auth and ip whitelisting

Maxim Dounin
April 12, 2012 05:50PM
Hello!

On Thu, Apr 12, 2012 at 05:39:42PM -0400, jaynyc wrote:

> Hi,
>
> I have set up Apache for an existing site to use either ip whitelisting
> or basic authentication. If the user's IP is not on the IP whitelist, it
> asks him for a password. My htaccess file looks something like this:
>
> ---------------
> Order deny,allow
> Deny from all
> AuthName "Restricted Area"
> AuthUserFile /path/to/passwords
> AuthType Basic
> Require valid-user
> Allow from 123.456.789.10
> Allow from 123.456.789.11
> Satisfy Any
> ---------------
>
> Is it possible to do something like this with Nginx?

http://nginx.org/r/satisfy

location / {
satisfy any;

allow 192.168.1.0/32;
deny all;

auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

combine basic auth and ip whitelisting

jaynyc April 12, 2012 05:39PM

Re: combine basic auth and ip whitelisting

Maxim Dounin April 12, 2012 05:50PM

Re: combine basic auth and ip whitelisting

Antonio P.P. Almeida April 13, 2012 03:42AM

Re: combine basic auth and ip whitelisting

jaynyc April 13, 2012 11:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready