Conditional http auth

Michael Shadle mike503 at
Sat Dec 4 01:04:41 MSK 2010

On Fri, Dec 3, 2010 at 1:07 PM, Boris Dolgov <boris at> wrote:
> No, it shouldn't.
> You can jump to named location inside if statement, and change authorization
> configuration there.

So are you saying something like

if ($http_via ~* "") {
   rewrite @protected permanent;

location @protected {
   auth_basic etc.

wouldn't I have to define the entire location / twice then? once
*inside* of that named location (because I need the entire base
location and such to be active, just behind auth)

More information about the nginx mailing list