Basic_auth for parts of uwsgi

Hi!

I have the following problem:

I’m running a uwsgi application using nginx on /. I would like to add
authentication for /foo/ and /bar/. However neither

location /bar/ {
auth_basic “LOGIN”;
auth_basic_user_file “/tmp/test/”;
}

nor

auth_basic "LOGIN";
auth_basic_user_file "/tmp/test/bar";

}
}

Seem to pass /foo/ and /bar/ to the wsgi socket and I can’t find a
solution on the interwebz.

Christoph


9FED 5C6C E206 B70A 5857 70CA 9655 22B9 D49A E731
Debian Developer | Lisp Hacker | CaCert Assurer

On Sun, Apr 28, 2013 at 01:05:37PM +0200, Christoph Egger wrote:

Hi there,

I’m running a uwsgi application using nginx on /. I would like to add
authentication for /foo/ and /bar/.

One request is handled in one location.

In the one location that handles the request “/foo/something”, you want
to have both “auth_basic” and “uwsgi_pass”.

In the one location that handles the request “/not-foo/something”, you
want to have “uwsgi_pass” but not “auth_basic”.

f

Francis D. [email protected]