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"';
         return 401;
     }
     ...
}

But nginx won't allow me to use the add_header directive inside an if block.
How can I achieve this?

via http://nginx.org/en/docs/http/ngx_http_auth_request_module.html

--
Best regards,
 Gena

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

Reply via email to