Welcome! Log In Create A New Profile

Advanced

Turn basic authentication on and off for specific HTTP user agent

November 26, 2012 03:24AM
Hello All!

Is it possible to turn authentication on and off for a specific user agent in some location? When I configure the following

location /specloc/ {
if ($http_user_agent ~ MSIE) {
auth_basic "private area";
auth_basic_user_file /etc/nginx/htpasswd;
}
#...
}

my "nginx -t" prints

nginx: [emerg] "auth_basic" directive is not allowed here in /etc/nginx/nginx.conf:75
nginx: configuration file /etc/nginx/nginx.conf test failed

Thank you if you answer.
SubjectAuthorPosted

Turn basic authentication on and off for specific HTTP user agent

hideNovember 26, 2012 03:24AM

Re: Turn basic authentication on and off for specific HTTP user agent

Ruslan ErmilovDecember 10, 2012 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready