Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx/Transmission reverse proxy

$
0
0
I have 2 servers (localhost & DIFFERENT.SERVER). on the local host I have SickRage and a few other web apps set up, on DIFFERENT.SERVER I have NZBGet and Transmission set up. SickRage and NZBGet work great - as advertised :).
My problem is Transmission, I am trying to nest it in <webRoot>/backend/torrent. I have not been successful in getting it to work. The interface renders when the page loads, but I get and error message "Connection Failed - Could not connect to the server. You may need to reload the page to reconnect". When I look in Chrome's dev console I see 2 errors:

1. POST http://localhost/backend/rpc 404 (Not Found)
2. Uncaught TypeError: Cannot read property 'updateButtonStates' of undefined

From the first error, the URL that was given it appears transmission is trying to go outside where it is nested. Everything else seems to reverse proxy fine. I have been trying different examples I have found on various blogs and forums, but had no success. What I have below is the closest I have gotten so far.

Has anyone out there gotten this to work, or can see what I might be doing wrong? Also is there a way I can clean up the 6 location statements to get transmission to work seems excessive.

default.conf in sites-available:

server {
listen 80;

server_name localhost;

# SickRage Reverse Proxy
location /tv {
proxy_pass http://localhost:8081;
include proxy-control.conf;
proxy_set_header Host localhost:8081;
proxy_redirect default;
port_in_redirect off;
}

# NZBGet Reverse Proxy
location ~ ^/backend/nzb$ {
return 302 $scheme://$host$request_uri/;
}

location ~ ^/backend/nzb($|./*) {
rewrite /backend/nzb/(.*) /$1 break;
proxy_pass http://DIFFERENT.SERVER:6789;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

# Transmission Reverse Proxy
location /backend/torrent/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/web/;
}

location /backend/torrent/rpc/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/rpc/;
}

location /backend/torrent/upload/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/upload/;
}

location /backend/torrent/web/style/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/web/style/;
}

location /backend/torrent/web/javascript/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/web/javascript/;
}

location /backend/torrent/web/images/ {
proxy_pass http://DIFFERENT.SERVER:9091/transmission/web/images/;
}
}


Should someone asks what is in the proxy-control.conf:

proxy_connect_timeout 59s;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffer_size 64k;
proxy_buffers 16 32k;
proxy_pass_header Set-Cookie;
proxy_hide_header Vary;

proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

proxy_set_header Accept-Encoding '';
proxy_ignore_headers Cache-Control Expires;
proxy_set_header Referer $http_referer;
proxy_set_header Host $host;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>