basic_auth for parts of uwsgi

Christoph Egger christoph at christoph-egger.org
Sun Apr 28 11:05:37 UTC 2013


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 / {
>   include uwsgi_params;
>   uwsgi_pass unix:/run/uwsgi/app/something/socket;
> }
>
> location /foo/ {
>   auth_basic "LOGIN";
>   auth_basic_user_file "/tmp/test/";
> }
>
> location /bar/ {
>   auth_basic "LOGIN";
>   auth_basic_user_file "/tmp/test/";
> }

nor

> location / {
>   include uwsgi_params;
>   uwsgi_pass unix:/run/uwsgi/app/something/socket;]
>
>   location /foo/ {
>     auth_basic "LOGIN";
>     auth_basic_user_file "/tmp/test/foo";
>   }
>
>   location /bar/ {
>     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



More information about the nginx mailing list