Re: Setting a header inside an if block

2014-02-06 Thread justink101
Thanks that worked perfectly, though I must admit, a bit of a round-a-bout solution. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,247218,247263#msg-247263 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/ngin

Re: Setting a header inside an if block

2014-02-06 Thread Ruslan Ermilov
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

Re: Setting a header inside an if block

2014-02-05 Thread justink101
I don't have the auth_request module? All I need to do, is set the WWW-Authenticate header. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,247218,247227#msg-247227 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listin

Re: Setting a header inside an if block

2014-02-05 Thread Gena Makhomed
On 05.02.2014 19:31, justink101 wrote: I currently have: server{ ... if ($remote_user = "") { return 401; } ... } But what I really want is: server{ ... if ($remote_user = "") { add_header WWW-Authenticate 'Basic realm="mydomainhere.com"';

Setting a header inside an if block

2014-02-05 Thread justink101
I currently have: server{ ... if ($remote_user = "") { return 401; } ... } But what I really want is: server{ ... if ($remote_user = "") { add_header WWW-Authenticate 'Basic realm="mydomainhere.com"'; return 401; } ... } But nginx won't al