[Solved] How to configure reverse proxy with nginx?

General support for problems installing or using Deluge
Post Reply
gurabli
New User
New User
Posts: 6
Joined: Mon Mar 23, 2015 11:30 am

[Solved] How to configure reverse proxy with nginx?

Post by gurabli »

Hi,

I'm having some real hard time to configure reverse proxy with nginx. I see many configurations, but I just can't make any of them work. Could you please post a howto for nginx with working configuration? I'm running deluged on Ubuntu Server 14.04. I have nginx installed. Please tell me exactly where to put what. I have a dynamic dns address that works fine.

I hope you can help me, it really drives me mad. I want to access webui with: dynamicdns.net/deluge from WAN.

Many thanks!
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: How to configure reverse proxy with nginx?

Post by Cas »

gurabli
New User
New User
Posts: 6
Joined: Mon Mar 23, 2015 11:30 am

Re: How to configure reverse proxy with nginx?

Post by gurabli »

I have everything up and running, it is working fine with nginx, but the upload torrent file through webui doesn't work. Any ideas how could I resolve this?
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: How to configure reverse proxy with nginx?

Post by Cas »

Look at the logs, could be permission related
gurabli
New User
New User
Posts: 6
Joined: Mon Mar 23, 2015 11:30 am

Re: How to configure reverse proxy with nginx?

Post by gurabli »

Nothing in logs, even with debug on. It looks it will be related to my nginx config. I stopped nginx and opened port 8112, accessed webui directly without reverse proxy and I could add files with upload. Now to troubleshoot why I can't add torrents using nginx reverse proxy, it will be a long road.

Interesting fact: I can add torrent with my Android phone with Transdroid, it works great, and I can also add over webui whit link, just file upload is not working. It must be something related to nginx permission or security setting. However, I don't get it how could Transdroid work, just browser not (tried ff, chrome, ie too).
gurabli
New User
New User
Posts: 6
Joined: Mon Mar 23, 2015 11:30 am

Re: How to configure reverse proxy with nginx?

Post by gurabli »

UPDATE & SOLVED:

After narrowing down the error to nginx, I finally found the problem. In order to prevent Clickjacking, everyone should use X-Frame-Options, like I do it too. Now this was set to DENY for my vhost where I run my Deluge reverse proxy. No wonder it prevented opening a page in frame or iframe -- like the webui upload.
It should be set to SAMEORIGIN, and everything is working as should. So the correct option, which is still very secure but doesn't limit functionality is:

Code: Select all

add_header X-Frame-Options SAMEORIGIN;
Transdroid was working fine with the same nginx config where X-Frame-Options were set to DENY since it doesn't open a new frame like webui does in browser.

Hope it will help others too!
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: How to configure reverse proxy with nginx?

Post by Cas »

Excellent, thanks for updating with that, I'll add it to wiki
Post Reply