1

I have nginx installed, and I want to use the built-in auth-basic module to authenticate on 2 different folders. Each folder should have its own user & password lists. For this i created 2 locations in the nginx config, and specified auth_basic_user_file for each of the defined locations.

Ex: /torrents/ is a proxy for a local install of transmission, and /admin/ is an administration interface developed by me.

The problem is that if i authenticate in one location it will log me out from the other location.

quamis
  • 362
  • 7
  • 18

1 Answers1

1

Using chromium and the following nginx configuration, I get a basic auth prompt the first time I visit each location, but after that, I can switch between them freely.

    location /torrents/ {
        auth_basic "transmission";
        auth_basic_user_file /tmp/transmission;
        alias /tmp/transmission/ ;
        autoindex on;
    }
    location /admin/ {
        auth_basic "administration";
        auth_basic_user_file /tmp/administration;
        alias /tmp/administration/ ;
        autoindex on;
    }

Note: tested on nginx/1.4.4

user76776
  • 436
  • 2
  • 4
  • you are right, on this simplified case it works, it might have something to do with proxy-ing data from transmission, or with the way transmission does its auth... I'll keep investigating – quamis Dec 31 '13 at 08:24