Question about redirect?

Maxim Dounin mdounin at mdounin.ru
Sat Jul 31 01:55:05 MSD 2010


Hello!

On Thu, Jul 22, 2010 at 12:08:16PM +0200, Slask Sklask wrote:

> Firstly I'm a newbie on both mailing lists AND nginx so please be nice to me
> :D
> 
> I use nginx as a reverse proxy and it works flawlessly.
> But now I want to put basic authentication on certain ip addresses.
> IE.
> 
> If I come from 10.0.0.0/24 network it should go through as usual.
> But if I come from 10.100.0.0/24 it should have basic authentication.
> Is there any way to accomplish this?


location / {
    satisfy any;

    allow  10.0.0.0/24;
    deny   all;

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

Most relevant link is:

http://wiki.nginx.org/NginxHttpCoreModule#satisfy_any

Directive "satisfy_any" was replaced by "satisfy" in 0.6.25.  
Somebody have to fix wiki.

Maxim Dounin



More information about the nginx mailing list