Welcome! Log In Create A New Profile

Advanced

Re: combine basic auth and ip whitelisting

Antonio P.P. Almeida
April 13, 2012 03:42AM
> 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?

auth_basic "Restricted Area"; # realm
auth_basic_user_file /path/to/passwords;


allow 123.456.789.10;
allow 123.456.789.11;
deny all;

satisfy any;


--appa

_______________________________________________
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: 243
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