Welcome! Log In Create A New Profile

Advanced

Re: Setting a header inside an if block

Ruslan Ermilov
February 06, 2014 04:08AM
On Wed, Feb 05, 2014 at 05:12:55PM -0500, justink101 wrote:
> I don't have the auth_request module? All I need to do, is set the
> WWW-Authenticate header.

So you only want to ensure that the basic authentication
was attempted, but don't want to check the credentials on
the nginx side? Here's how:

http {
map $remote_user $realm {
'' mydomainhere.com;
default off;
}

server {
auth_basic $realm;
auth_basic_user_file /dev/null;
}
}

It means that HTTTP basic authentication by nginx will be
disabled ("off") if $remote_user is not empty, and enabled
(and return 401 with an appropriate header) otherwise.

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

Setting a header inside an if block

justink101 February 05, 2014 12:31PM

Re: Setting a header inside an if block

Gena Makhomed February 05, 2014 01:40PM

Re: Setting a header inside an if block

justink101 February 05, 2014 05:12PM

Re: Setting a header inside an if block

Ruslan Ermilov February 06, 2014 04:08AM

Re: Setting a header inside an if block

justink101 February 06, 2014 03:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 262
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