# Problem with auth\_basic + proxy\_pass + transmission-daemon

**URL:** <https://www.ruby-forum.com/t/problem-with-auth-basic-proxy-pass-transmission-daemon/226864>\
**Category:** NGINX\
**Created:** [February 23, 2013, 10:12pm UTC](https://www.ruby-forum.com/t/problem-with-auth-basic-proxy-pass-transmission-daemon/226864 "2013-02-23T22:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![larios](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@larios](https://www.ruby-forum.com/u/larios)\
**Post date:** [February 23, 2013, 10:12pm UTC](https://www.ruby-forum.com/t/problem-with-auth-basic-proxy-pass-transmission-daemon/226864/1 "2013-02-23T22:12:00Z")

</div>

Hello list,

While using nginx 1.3.12 + transmission-daemon 2.77 + Ubuntu 12.04,

# /etc/transmission-daemon/settings.json

```
...
"rpc-bind-address": "127.0.0.1",
"rpc-port": 9091,
"rpc-url": "/transmission/",
...

```

ls -l /etc/nginx/.htpasswdtrans  
-rw-r----- 1 root www-data 64 … /etc/nginx/.htpasswdtrans

Trying to browse to: [https://example.localdomain/transmission](https://example.localdomain/transmission)

WORKS IF:  
location /transmission {  
proxy\_pass [http://127.0.0.1:9091/transmission](http://127.0.0.1:9091/transmission);  
}

DOES NOT WORK IF:  
location /transmission {  
auth\_basic “Restricted Area”;  
auth\_basic\_user\_file .htpasswdtrans;  
proxy\_pass [http://127.0.0.1:9091/transmission](http://127.0.0.1:9091/transmission);  
}

AND GIVES THESE ERRORS:  
==\> /var/log/nginx/access.log \<==  
192.168.0.70 - - [23/Feb/2013:20:38:19 +0000] “POST /transmission/rpc  
HTTP/1.1” 302 158 “[https://example.localdomain/transmission/web/](https://example.localdomain/transmission/web/)”  
“Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101  
Firefox/19.0” 192.168.0.70 - - [23/Feb/2013:20:38:19 +0000]  
“{\x22method\x22:\x22session-get\x22}” 400 170 “-” “-”  
[error] 6012#0: \*799 no user/password was provided for basic  
authentication, client: 192.168.0.70, server: example.localdomain,  
request: “GET /transmission/web/style/transmission/images/logo.png  
HTTP/1.1”, host: “example.localdomain”, referrer:  
“[https://example.localdomain/transmission/web/style/transmission/common.css](https://example.localdomain/transmission/web/style/transmission/common.css)”

==\> /var/log/nginx/error.log \<==  
2013/02/23 20:38:19 [error] 6012#0: \*799 no user/password was provided  
for basic authentication, client: 192.168.0.70, server:  
example.localdomain, request:  
“GET /transmission/web/style/transmission/images/logo.png HTTP/1.1”,  
host: “example.localdomain”, referrer:  
“[https://example.localdomain/transmission/web/style/transmission/common.css](https://example.localdomain/transmission/web/style/transmission/common.css)”

Note:  
Adding the following to the ‘location /transmission’, or to the  
parent server {} did not help:  
proxy\_redirect off;  
proxy\_set\_header Host $http\_host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Real-IP $remote\_addr;

Any ideas on how to make ‘auth\_basic’ work?

Thank you.

M.
