0

I've been working around this configuration but to no avail. What I am trying to achieve is to mask my url from http://subdomain.domain.com:9091/transmission/web/ to http://subdomain.domain.com/tr/

This is what I've come on with so far

nginx default.conf

location /tr/ {
proxy_read_timeout 300;
proxy_pass_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:9091/transmission/web/;
proxy_redirect off;
}

The transmission web interface did show up but the css, jss and img is all 404. is there any workaround for this?

Thanks in advance.

teDDy
  • 11
  • 1
  • 3

2 Answers2

4

maybe a bit late...

upstream transmissionweb {
    server localhost:9091;
}

server {

    server_name     www.example.com;
    root            /var/www/www.example.com;

    access_log  /var/log/nginx/www.example.com.access.log;
    error_log   /var/log/nginx/www.example.com.error.log;


    location /transmission {
        proxy_pass          http://transmissionweb;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect      off;
        proxy_buffering     off;
        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
    }

}
Timmy Chiu
  • 549
  • 4
  • 13
3

I use the following config for proxying to Transmission. Please note "location /torrent/" - I changed default "rpc-url" setting in Transmission from "/transmission/" to "/torrent/".

This works with nginx/1.2.7 and transmission 2.51 under Ubuntu 12.04.2 LTS.

upstream transmission {
    server 127.0.0.1:9091;
    keepalive 4;
}

server {
    listen 80;

    server_name localhost;

    location /torrent/ {
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_pass_header X-Transmission-Session-Id;

        location /torrent/rpc {
            proxy_pass http://transmission;
        }

        location /torrent/web/ {
            proxy_pass http://transmission;
        }

        location /torrent/upload {
            proxy_pass http://transmission;
        }

        location /torrent/web/style/ {
            alias /usr/share/transmission/web/style/;
        }

        location /torrent/web/javascript/ {
            alias /usr/share/transmission/web/javascript/;
        }

        location /torrent/web/images/ {
            alias /usr/share/transmission/web/images/;
        }
    }
}
Andrei Belov
  • 1,131
  • 9
  • 8