Qbittorrent: WebUI - Can't Login via Nginx Reverse Proxy

Created on 20 Jan 2020  ·  3Comments  ·  Source: qbittorrent/qBittorrent

Please provide the following information

qBittorrent version and Operating System

4.2.1 - Linux Mint 19.2

If on linux, libtorrent-rasterbar and Qt version

libtorrent 1.2.3

What is the problem

Can't login via nginx reverse proxy. I can login fine on my local network but if i try to login remotely using a nginx proxy, nothing happens. I can login into all my other applications via nginx. I dont even get an error message saying my login info is incorrect or anything. I'm able to connect via mobile android apps as well just cant via a browser for some reason. It seems like my nginx config might be wrong. I'm using the config it says to use.

location /qbt/ {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $server_name:$server_port;
proxy_hide_header Referer;
proxy_hide_header Origin;
proxy_set_header Referer '';
proxy_set_header Origin '';
# proxy_set_header Host 127.0.0.1:8080; # if you use the "enable host header validation" setting with 127.0.0.1 in the "server domains" text box
# add_header X-Frame-Options "SAMEORIGIN"; # not needed since 4.1.0
}

Any help would be greatly appreciated.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

WebUI

Most helpful comment

This is what I'm using for my nginx setup:

location ^~ /qbt/ {
    resolver 127.0.0.1 valid=30s;
    proxy_pass http://127.0.0.1:8080/; # use whatever port you have setup in qBt

    client_max_body_size 10m;
    client_body_buffer_size 128k;

    #Timeout if the real server is dead
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

    # Advanced Proxy Config
    send_timeout 5m;
    proxy_read_timeout 240;
    proxy_send_timeout 240;
    proxy_connect_timeout 240;

    proxy_redirect  http://  $scheme://;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    #proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps
    proxy_cache_bypass $cookie_session;
    proxy_no_cache $cookie_session;
    proxy_buffers 32 4k;

    proxy_set_header        X-Forwarded-Host        $server_name:$server_port;
    proxy_hide_header       Referer;
    proxy_hide_header       Origin;
    proxy_set_header        Referer                 '';
    proxy_set_header        Origin                  '';
    add_header              X-Frame-Options         "SAMEORIGIN"; # see note
}

I'd also make sure you're not running into problems with upgrading from 1.x to 2.x in terms of updating the password. Take a look at these issues: https://github.com/qbittorrent/qBittorrent/issues/11680 https://github.com/qbittorrent/qBittorrent/issues/11571.

Okay I'm getting somewhere. I'm able to login via Microsoft Edge but not the latest version of chrome or firefox.

This also makes me think it's a cookie issue. I'd delete your cookies on the domain you're using just in case even though you have it disabled in your nginx config.

All 3 comments

Okay I'm getting somewhere. I'm able to login via Microsoft Edge but not the latest version of chrome or firefox.

This is what I'm using for my nginx setup:

location ^~ /qbt/ {
    resolver 127.0.0.1 valid=30s;
    proxy_pass http://127.0.0.1:8080/; # use whatever port you have setup in qBt

    client_max_body_size 10m;
    client_body_buffer_size 128k;

    #Timeout if the real server is dead
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

    # Advanced Proxy Config
    send_timeout 5m;
    proxy_read_timeout 240;
    proxy_send_timeout 240;
    proxy_connect_timeout 240;

    proxy_redirect  http://  $scheme://;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    #proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps
    proxy_cache_bypass $cookie_session;
    proxy_no_cache $cookie_session;
    proxy_buffers 32 4k;

    proxy_set_header        X-Forwarded-Host        $server_name:$server_port;
    proxy_hide_header       Referer;
    proxy_hide_header       Origin;
    proxy_set_header        Referer                 '';
    proxy_set_header        Origin                  '';
    add_header              X-Frame-Options         "SAMEORIGIN"; # see note
}

I'd also make sure you're not running into problems with upgrading from 1.x to 2.x in terms of updating the password. Take a look at these issues: https://github.com/qbittorrent/qBittorrent/issues/11680 https://github.com/qbittorrent/qBittorrent/issues/11571.

Okay I'm getting somewhere. I'm able to login via Microsoft Edge but not the latest version of chrome or firefox.

This also makes me think it's a cookie issue. I'd delete your cookies on the domain you're using just in case even though you have it disabled in your nginx config.

@j-remy11 Are you still having problems?

Was this page helpful?
0 / 5 - 0 ratings