1. My Caddy version (caddy version
):
v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q=
2. How I run Caddy:
I run caddy through systemd on a RHEL 8.2 server. It is a reverse proxy for local containers.
a. System environment:
RHEL 8.2 x64, systemd
b. Command:
/usr/local/bin/caddy run --config /etc/caddy/Caddyfile --environ
c. Service/unit/compose file:
[Unit]
Description=Caddy Web Server
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/local/bin/caddy run --config /etc/caddy/Caddyfile --environ
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
mediabox.noodlesauce.com {
reverse_proxy /deluge* 127.0.0.1:8112 {
header_up X-Deluge-Base "/deluge/";
header_down X-Frame-Options SAMEORIGIN;
}
log {
level debug
}
}
3. The problem I’m having:
I’m unable to access Deluge on a sub URI through a reverse proxy with Caddy. I receive a “No Such Resource” error from the twisted web server within my Deluge container.
This same configuration proxied through Nginx works fine. Relevant Nginx config:
location /deluge {
proxy_pass http://localhost:8112/;
proxy_set_header X-Deluge-Base "/deluge/";
add_header X-Frame-Options SAMEORIGIN;
}
4. Error messages and/or full log output:
When visiting mediabox.noodlesauce.com/deluge, I’m greeted with:
No Such Resource
No such child resource.
Here’s the Caddy log:
May 02 03:37:31 exa.h.noodlesauce.com caddy[26052]: {“level”:“error”,“ts”:1588405051.5211046,“logger”:“http.log.access.log0”,“msg”:“handled request”,“request”:{“method”:“GET”,“uri”:"/deluge",“proto”:“HTTP/2.0”,“remote_addr”:“10.0.1.1:63033”,“host”:“mediabox.noodlesauce.com”,“headers”:{“Accept-Language”:[“en-us”],“Accept-Encoding”:[“gzip, deflate, br”],“User-Agent”:[“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”]},“tls”:{“resumed”:false,“version”:772,“ciphersuite”:4865,“proto”:“h2”,“proto_mutual”:true,“server_name”:“mediabox.noodlesauce.com”}},“common_log”:“10.0.1.1 - - [02/May/2020:03:37:31 -0400] “GET /deluge HTTP/2.0” 404 153”,“latency”:0.000810056,“size”:153,“status”:404,“resp_headers”:{“Server”:[“Caddy”,“TwistedWeb”],“Date”:[“Sat, 02 May 2020 07:37:31 GMT”],“Content-Type”:[“text/html; charset=utf-8”],“Content-Length”:[“153”],“X-Frame-Options”:[“SAMEORIGIN;”]}}
5. What I already tried:
I’ve attempted numerous permutations of the “header” directive, and the “header_up” and “header_down” settings under reverse_proxy. Also many different permutations of the matcher (/deluge, /deluge/, /deluge*, etc.).