Trouble creating reverse proxy caddy service

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

This is what I’m confused with. When I try and run caddy using a simple Caddyfile, my reverse proxy for jelly fin on my domain works. However, when I create a Caddyfile in /etc/caddy/Caddy file with the recommended

jellyfin.williamthrilliam.com {
	reverse_proxy 127.0.0.1:8096
}

I get the default caddy splashpage at my domain.

a. System environment:

Ubuntu 22.10 server (headless) Intel N6005 with all the updates.

b. Command:

sudo nano /etc/caddy/Caddyfile
sudo chown caddy /etc/caddy/Caddyfile
sudo chgrp caddy /etc/caddy/Caddyfile
sudo systemctl reload caddy

c. Service/unit/compose file:

N/A

d. My complete Caddy config:

jellyfin.williamthrilliam.com {
	reverse_proxy 127.0.0.1:8096
}

3. The problem I’m having:

If I run caddy with a simple un-formated Caddyfile via the command line, my redirect works great and I’m able to access jellyfin at jellyfin.williamthrilliam.com. Of course that’s lost on reboot, so I’m trying to get this to persist.

4. Error messages and/or full log output:

Nov 21 16:22:27 chonker systemd[1]: Reloading Caddy...
Nov 21 16:22:27 chonker caddy[1963]: {"level":"info","ts":1669047747.945518,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.946896,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"48296","headers":{"Accept-Encoding":["gzip"],"Cache-Control":["must-revalidate"],"Content-Length":["266"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9474847,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.947579,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9475918,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9477246,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9477446,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9477732,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.947778,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["jellyfin.williamthrilliam.com"]}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9478652,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000492b60"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.9483564,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc000484cb0"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.948491,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.948535,"logger":"admin.api","msg":"load complete"}
Nov 21 16:22:27 chonker caddy[1832]: {"level":"info","ts":1669047747.949602,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
Nov 21 16:22:27 chonker systemd[1]: Reloaded Caddy.

5. What I already tried:

Everything described here: Novice trying to reverse proxy with caddy for Jellyfin - problems

6. Links to relevant resources:

Above

Well, I don’t know exactly what I did, but I got it working.

Instead of the Caddyfile with markup, I just created a simple Caddy ile in /etc/caddy/Caddyfile

jellyfin.williamthrilliam.com

reverse_proxy 127.0.0.1:8096

I then did the following:

sudo systemctl stop --now caddy
sudo systemctl disable caddy
caddy stop
sudo systemctl enable caddy
sudo systemctl start caddy

I did a hard reload (cleard cache) on my browser (honestly this might have been the issue to begin with), and then viola!

Usually browser caches are the problem. Always test with curl -v :+1:

Thanks for following up with your solution!

This topic was automatically closed after 30 days. New replies are no longer allowed.