Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have my working on default port and I want to be able to use the web interface with an URL like http://my.domain/torrents.

I tried adding a location and a proxy conf to Nginx but it fail to work fully. I guess it's because of web interface redirections.

server {
    root /data/www;
    autoindex on;

    server_name localhost;

    location / {
            try_files $uri $uri/ /index.html;
    }

    location /torrents/ {
            proxy_pass_header  X-Transmission-Session-Id;
            proxy_pass         http://127.0.0.1:9091;
    }
}

This conf fail because it can't reach /transmission/rpc (404 /usr/share/transmission/web/rpc) I have tried many things and I always have something missing. transmission/rpc or transmission/upload or transmission/web or transmission/javascript/whatever...

share|improve this question

1 Answer 1

Your config says that only urls which start with /torrents/ should be proxy_passed to http://127.0.0.1:9091. For any other url like /transmission nginx will use the first location / and hence not proxy_pass it to the backend.

If you want every request to be proxy passed to the backend, you would need this location instead of the two you have:

location / {
        proxy_pass_header  X-Transmission-Session-Id;
        proxy_pass         http://127.0.0.1:9091;
}
share|improve this answer
    
Thanks for your answer, I use nginx as my web server so I don't want to forward all requests to the transmission web interface. Only those coming from /torrents/. But you point out that my basic web configuration may be one part of the problem. I will continu to investigate. –  cyrbil Feb 18 '13 at 14:11
    
You say you have this webinterface on /torrents, and it's linking to urls like /transmission, right? maybe the problem is just that this webinterface isn't aware of the /torrents prefix, so it generates the links wrong. so maybe the correct link would be /torrent/transmission? Then the problem is probably in the configuration of this webinterface, somewhere you would need to configure that the prefix for every url should be /torrent –  mauro.stettler Feb 18 '13 at 14:17
    
if you want to say thanks, please upvote –  mauro.stettler Feb 18 '13 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.