NginX "403 Forbidden" when trying to access Deluge webUI

General support for problems installing or using Deluge
Post Reply
RalphORama
New User
New User
Posts: 3
Joined: Sat Sep 12, 2015 6:35 pm

NginX "403 Forbidden" when trying to access Deluge webUI

Post by RalphORama »

Hello,
I tried setting up Deluge to forward through an NginX reverse proxy, but I'm getting a "403 forbidden" response whenever I try to access the webui. I go to mydomain.x/deluge and the auth window (presumably from NginX) pops up. I enter my username and password, and am greeted with the "403 forbidden" page. Any idea what might be the problem?
(Note: the domain I'm using is https-only, so I'm visiting https://domain.x/deluge)

Here's the relevant part of my NginX config:

Code: Select all

location /deluge {
        proxy_pass http://127.0.0.1:8112/;
        proxy_set_header X-Deluge-Base "/deluge/";
        proxy_cookie_domain 127.0.0.1 localhost;
        proxy_cookie_path / /deluge;

        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/media-proxy/auth;

        proxy_redirect          off;
        proxy_buffering         off;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
}
Here's my web.conf:

Code: Select all

{
  "file": 1,
  "format": 1
}{
  "port": 8112,
  "enabled_plugins": [],
  "pwd_sha1": "x",
  "theme": "gray",
  "show_sidebar": true,
  "sidebar_show_zero": false,
  "pkey": "ssl/daemon.pkey",
  "https": false,
  "sessions": {},
  "base": "/",
  "pwd_salt": "x",
  "show_session_speed": false,
  "first_login": true,
  "cert": "ssl/daemon.cert",
  "session_timeout": 3600,
  "default_daemon": "",
  "sidebar_multiple_filters": true
Here's my core.conf:

Code: Select all

{
  "file": 1,
  "format": 1
}{
  "info_sent": 0.0,
  "lsd": true,
  "send_info": false,
  "move_completed_path": "/var/lib/deluge/Downloads",
  "enc_in_policy": 1,
  "queue_new_to_top": false,
  "ignore_limits_on_local_network": true,
  "rate_limit_ip_overhead": true,
  "daemon_port": 58846,
  "natpmp": true,
  "max_active_limit": 8,
  "utpex": true,
  "max_active_downloading": 3,
  "max_active_seeding": 5,
  "allow_remote": true,
  "max_half_open_connections": 50,
  "download_location": "/var/lib/deluge/Downloads",
  "compact_allocation": false,
  "max_upload_speed": -1.0,
  "cache_expiry": 60,
  "prioritize_first_last_pieces": false,
  "auto_managed": true,
  "enc_level": 2,
  "max_connections_per_second": 20,
  "dont_count_slow_torrents": false,
  "random_outgoing_ports": true,
  "max_upload_slots_per_torrent": -1,
  "new_release_check": false,
  "enc_out_policy": 1,
  "outgoing_ports": [
    0,
    0
  ],
  "seed_time_limit": 180,
  "cache_size": 512,
  "share_ratio_limit": 2.0,
  "max_download_speed": -1.0,
  "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat",
  "torrentfiles_location": "/var/lib/deluge/Downloads",
  "stop_seed_at_ratio": false,
  "peer_tos": "0x00",
  "listen_interface": "",
  "upnp": true,
  "max_download_speed_per_torrent": -1,
  "max_upload_slots_global": 4,
  "enabled_plugins": [],
  "random_port": true,
  "autoadd_enable": false,
  "max_connections_global": 200,
  "enc_prefer_rc4": true,
  "listen_ports": [
    6881,
    6891
  ],
  "dht": true,
  "stop_seed_ratio": 2.0,
  "seed_time_ratio_limit": 7.0,
  "max_upload_speed_per_torrent": -1,
  "copy_torrent_file": false,
  "del_copy_torrent_file": false,
  "move_completed": false,
  "proxies": {
    "peer": {
      "username": "",
      "password": "",
      "type": 0,
      "hostname": "",
      "port": 8080
    },
    "web_seed": {
      "username": "",
      "password": "",
      "type": 0,
      "hostname": "",
      "port": 8080
    },
    "tracker": {
      "username": "",
      "password": "",
      "type": 0,
      "hostname": "",
      "port": 8080
    },
    "dht": {
      "username": "",
      "password": "",
      "type": 0,
      "hostname": "",
      "port": 8080
    }
  },
  "add_paused": false,
  "max_connections_per_torrent": -1,
  "remove_seed_at_ratio": false,
  "autoadd_location": "/var/lib/deluge/Downloads",
  "plugins_location": "/var/lib/deluge/.config/deluge/plugins"
}
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: NginX "403 Forbidden" when trying to access Deluge webUI

Post by Cas »

If it's https does that not mean you would need to setup Deluge Webui too...
RalphORama
New User
New User
Posts: 3
Joined: Sat Sep 12, 2015 6:35 pm

Re: NginX "403 Forbidden" when trying to access Deluge webUI

Post by RalphORama »

Cas wrote:If it's https does that not mean you would need to setup Deluge Webui too...
Would I have to? I assumed that I could leave deluge non-https and let NginX handle conversion. I'll give that a shot

EDIT 1: nope, I changed SSL to "true" in web.conf, same error.
EDIT 2: If I go to https://xxx.xxx.xxx.xxx:8112 (the raw IP of my server), I am able to log into the webUI, with an "invalid certificate" warning. However, I changed the nginx proxy to https instead of http, and still get the 403 error.
EDIT 3: I am unable to change the default password from the webUI. Perhaps this could be part of the issue?
RalphORama
New User
New User
Posts: 3
Joined: Sat Sep 12, 2015 6:35 pm

Re: NginX "403 Forbidden" when trying to access Deluge webUI

Post by RalphORama »

Apologies for the double post.

I've found out the issue was that I didn't properly have my htpasswd configured. However, I've run into another issue. It appears I'm unable to stop the webUI so that I can edit web.conf. When I try the recommended method of pkill deluged, the process remains steady, or starts up again, I'm not quite sure which. What could be the reason for this?

Edit: I'd like to do this because I'm getting the infinite password prompt issue - no matter how many times I enter the password for the webUI, the password box pops back up.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: NginX "403 Forbidden" when trying to access Deluge webUI

Post by Cas »

If you are running it as a service, stop the service. Also deluged is not the same as deluge-web (unless you are using the webui plugin which is not recommended in this setup)
Post Reply