6c65726f79 / Transmissionic

Remote for Transmission Daemon
MIT License
449 stars 31 forks source link

Not loading behind reverse proxy #803

Open sn0wcrashing opened 2 years ago

sn0wcrashing commented 2 years ago

This may be intended behaviour? If so please move to enhancement

Describe the bug WebUI not populating torrents list etc when used behind a reverse proxy. Remains with the animated loading circle.

To Reproduce Place behind a reverse proxy (HA Proxy in my case) using a sub-domain (e.g. transmission.sub-domain.tld) and load in web browser.

Platform: Tested on MacOS Safari, Windows 10 Firefox.

I haven't done extensive testing, just loaded this yesterday and it looks great (thank-you) but didn't load when using sub-domain address. Locally using IP address/port it loaded correctly.

6c65726f79 commented 2 years ago

Hi, thank you for reporting this issue. It's indeed a bug.

When you click on the pencil next to the server name, are the host and port the right ones? And are you using HTTPS?

sn0wcrashing commented 2 years ago

Yes they look correct, using https on port 443, with acme handling certificates on the reverse proxy. I can’t edit the authentication fields when editing the server.

6c65726f79 commented 2 years ago

Ok thanks for the information, I'll try to reproduce this bug on my side.

6c65726f79 commented 2 years ago

Hi, so I didn't managed to reproduce this bug. Could you open the dev tools (Ctrl+Shift+I) and show me if there's an error in the console tab? Thanks!

github-actions[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

sn0wcrashing commented 2 years ago

Hi, so I didn't managed to reproduce this bug. Could you open the dev tools (Ctrl+Shift+I) and show me if there's an error in the console tab? Thanks!

Sorry for the slowness in my response.

Errors from Chrome in the Console are;

Failed to load resource: the server responded with a status of 404 (Not Found)

and

Failed to load resource: the server responded with a status of 409 (Conflict)

Chrome Console Error Screenshot

abubaca4 commented 2 years ago

work with this nginx config

location = /transmission/ {
                return 301 /transmission/web/;
        }

        proxy_hide_header X-Frame-Options;

        location /transmission/ {
                proxy_http_version 1.1;
                proxy_set_header Connection "";
                proxy_read_timeout  300;
                proxy_set_header    Host                 $host;
                proxy_set_header    X-Forwarded-Proto    $scheme;
                proxy_set_header    X-Forwarded-Protocol $scheme;
                proxy_set_header    X-Real-IP            $remote_addr;
                proxy_pass_header   X-Transmission-Session-Id;
                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;
                proxy_pass          http://localhost:9091/transmission/;
        }

Try to set HA Proxy like this

mateuszdrab commented 1 year ago

Just discovered the app today @6c65726f79 thanks for developing it

I'm presuming the reason why it wouldn't work is if the SNI header isn't sent with TLS.

I too can't get the UI to work behind Haproxy. I'll check if the header is sent and report back.

mateuszdrab commented 1 year ago

So it seems the issue was caused by a setting of Transmission, not the SNI as I initially suspected. In the settings.json file located in /usr/local/etc/transmission/home (in case of the TrueNAS jail), you need to disable the rpc-host-whitelist-enabled setting. Make sure to kill the transmission process first as in my case, it overwrote the file when gracefully restarted.

6c65726f79 commented 1 year ago

Thank you for sharing your solution @mateuszdrab, I hope this will help others.

By the way, thank you for the tip, it's greatly appreciated!

mateuszdrab commented 1 year ago

Thank you for sharing your solution @mateuszdrab, I hope this will help others.

By the way, thank you for the tip, it's greatly appreciated!

I hope so too, since anyone behind a reverse proxy would probably be accessing via another hostname and by default RPC was being blocked. I couldn't even connect to it directly via hostname without the reverse proxy in the way.

Definitely deserve more tips buddy, I'm sure it took a while to make this app. The default web GUI for transmission is so ugly 😄

timothe commented 1 year ago

Unfortunately this doesn't solve the issue for me. Transmission is on a Synology NAS behind a reverse proxy using a VPN. The 443 port is exposed and the Web UI is working. RPC communication seems to be working as well. But Transmissionic doesn't. I'm stuck on "Unable to reach host". Nothing shown in the developer tools.

once375ml commented 11 months ago

Unfortunately this doesn't solve the issue for me. Transmission is on a Synology NAS behind a reverse proxy using a VPN. The 443 port is exposed and the Web UI is working. RPC communication seems to be working as well. But Transmissionic doesn't. I'm stuck on "Unable to reach host". Nothing shown in the developer tools.

I met the same situation and come here. I am sure you edited the "Server" section.

I also use reverse proxy for https connection. Transmissionic works if I don't touch any parameters in "Server" . Otherwise, I will also see "Unable to reach host".

By the way, Where can I get the configuration file in client side? I want to make it "default.json" and upload to server side.

remlio commented 11 months ago

on https connections, the port must be 443, not 14000

once375ml commented 11 months ago

on https connections, the port must be 443, not 14000

It's not the problem of port in synology reverse proxy.

Transmissionic remembers the proxy domain, port and path locally, rather than the real domain, port and path from server.