Tutorial: Caddy (Reverse Proxy) + Let's Encrypt Certificates + Dynamic DNS

Started by Monviech (Cedrik), February 09, 2024, 01:31:44 PM

Previous topic - Next topic
Thanks- I deleted the file and don't see the error now after bouncing the service.

Here's the 'before' and 'after' state:

root@firewall:~ # cd /var/run/caddy/
root@firewall:/var/run/caddy # ls -l
total 2
-rw-rw----  1 root www 6 Mar 14 23:00 caddy.pid
s-w--w----  1 root www 0 Mar 14 23:00 caddy.sock
srw-rw-rw-  1 root www 0 Mar 14 22:57 log.sock
root@firewall:/var/run/caddy #
root@firewall:/var/run/caddy # rm caddy.sock

(bounced the service here)

root@firewall:/var/run/caddy # ls -l
total 2
-rw-------  1 www  www 6 Mar 15 07:32 caddy.pid
s-w--w----  1 www  www 0 Mar 15 07:32 caddy.sock
srw-rw-rw-  1 root www 0 Mar 14 22:57 log.sock


I'm getting an error in the Caddy log when trying to use the reverse proxy on a Plex instance.  The log shows:

"error","ts":"2025-03-19T23:36:47Z","logger":"http.log.error","msg":"EOF","request":{"remote_ip":"192.168.x.xxx","remote_port":"50589","client_ip":"192.168.x.xxx","proto":"HTTP/2.0","method":"GET","host":"plexsub.mydomain.com","uri":"/media/providers?X-Plex-Product=Plex%20Web&X-Plex-Version=4.145.1&X-Plex-Client-Identifier=y1574g5pgysu0b7435g9qsqd&X-Plex-Platform=Firefox&X-Plex-Platform-Version=136.0&X-Plex-Features=external-media%2Cindirect-media%2Chub-style-list&X-Plex-Model=bundled&X-Plex-Device=Windows&X-Plex-Device-Name=Firefox&X-Plex-Device-Screen-Resolution=1536x731%2C1536x864&X-Plex-Token=TWeNgtGispep-E4RBR1m&X-Plex-Language=en&X-Plex-Session-Id=72ff17fc-21db-4b3b-8437-9194ca66bd7d","headers":{"Referer":["http://192.168.x.xxx:32400/"],"Accept-Encoding":["gzip, deflate, br, zstd"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0"],"Accept-Language":["en"],"Dnt":["1"],"Sec-Fetch-Site":["cross-site"],"Accept":["application/json"],"Sec-Fetch-Dest":["empty"],"Sec-Fetch-Mode":["cors"],"Sec-Gpc":["1"],"Te":["trailers"],"Origin":["http://192.168.x.xxx:32400"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"plexsub.mydomain.com"}},"duration":0.000950754,"status":502,"err_id":"kr1iycyqd","err_trace":"reverseproxy.statusError (reverseproxy.go:1373)"}

Plex is stating that remote access through the reverse proxy doesn't work.  Is this something easily fixed?

TWIMC Just warning here that DNS Providers might get a bit more inconvenient soon.

https://github.com/opnsense/plugins/issues/4643

Only cloudflare will remain default compiled in as it is maintained directly by the caddy organization. All other providers will be optionally installable via CLI with e.g.

caddy add-package github.com/caddy-dns/duckdns

https://caddyserver.com/docs/command-line#caddy-add-package

If they won't compile after the caddy binary is updated to caddy-v2.10.0 please reach out to their maintainers via https://github.com/caddy-dns

This had happened once already and I don't want to run after 40 repos with for something I don't even use personally (I dont use dns-challenge or dynamic-dns, I maintain this in my free time)
Hardware:
DEC740