I currently have Caddy reverse proxying various services of mine without issue. However, I’m struggling to get a reverse proxy working with Deluge. http://deluge-torrent.org/
This is what I currently have in my caddyfile for the deluge reverse proxy:
Did you specify the base path required for Deluge as specified in the user guide you’ve linked to? You can either use a command line argument for Deluge or set a header_upstream for Caddy.
Can you give me an example of what my code would turn into if I used header_upstream? I already have one line using header_upstream - does a second get added?
I’m extremely new to Caddy - would it look like this or something?
I still haven’t figured out a working solution yet. Does anyone else have any ideas? I’ve posted in both the Deluge forum and their IRC, and haven’t gotten any responses yet from either.
With help on reddit, I was able to get Deluge working 90% of the way using the following. It seems like some of the icons in Deluge are wonky, but this is as close as I could get.
rewrite {
if {>Referer} has /deluge
to /deluge/{path}
}
proxy /deluge http://127.0.0.1:8112 {
without /deluge
transparent
header_upstream X-Forwarded-Host {host}
}
Does anyone know what could be changed/added to allow Deluge to fully display properly?
No, not a 404. It successfully connects in, and I can interact with it. However, some of the webpage elements didn’t load fully. For instance, the the webUI password box that appears is missing it’s outline and background. I can still type in my password and get in, but in some of the menus the lack of loading makes it a little bit tough.
Those are 404s though. That means the basic configuration seems correct but the assets (maybe only images) are missed out.
Can you access the deluge instance directly and get the path to the images. Then we can compare with the request path from Caddy to find any possible mismatch.
I think I’ve got it solved (with much help over on reddit). Below is the code I have that got it to work. This is inside my mydomain.com:443 code block.
rewrite {
if_op or
if {>Referer} has /deluge
if {>Referer} has mydomain.com/themes/css/
if {>Referer} has mydomain.com/css/
to /deluge/{path}
}
proxy /deluge http://127.0.0.1:8112 {
without /deluge
transparent
header_upstream X-Forwarded-Host {host}
}
Just change ‘mydomain.com’ to your actual domain name. No more 404 errors on the page, and all assets load! For a version that works within a localhost:80 code block, you can use this:
rewrite {
if_op or
if {>Referer} has /deluge
if {>Referer} has /localhost/themes/css/
if {>Referer} has /localhost/css/
to /deluge/{path}
}
proxy /deluge http://127.0.0.1:8112 {
without /deluge
transparent
header_upstream X-Forwarded-Host {host}
}
FYI I have a working Deluge setup that is a bit simpler, this is running on Caddy 0.9.3: proxy /deluge http://deluge:8112/ { transparent without /deluge header_upstream X-Deluge-Base "/deluge" }