Hello,
Is it possible to have auth_basic active for a range of ips or a specified ip only ?
[code]
geo $geo {
default 0;
127.0.0.1/32 2;
192.168.1.0/24 1;
10.1.0.0/16 1;
217.12.113.114 3;
}
server {
listen 80;
server_name mysite.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
#satisfy_any on;
# allow 193.104.211.86;
# include /root/nginx_exp/nginx/ban_list;
if ( $geo = 3 ) {
auth_basic "Restricted";
auth_basic_user_file /root/nginx_exp/nginx/my_passwords;
}
}
[/code]
This code should activate auth_basic for 217.12.113.114 only, other IPs should access the server without any authorization
but it doesn't work.... ( i know this is a very primitive code )
Any ideas ?
Edited 1 time(s). Last edit at 02/26/2010 02:55AM by denybell.