Jellyfin Forum
Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. (/t-jellyfin-reverse-proxy-with-caddy-and-duckdns-throwing-errors-while-streaming)



Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - fedonr - 2024-06-07

Okay so what happens is there is no error logs in Jellyfin Docker Container, but when I use Caddy to reverse proxy my Media Server it gives me error logs as soon as I start any stream on Jellyfin. And after a while like 20 minutes or so, suddenly my reverse proxy URLs would crash and streaming crashes, but again after 2 minutes or so it would start working again. But if I start streaming again on Jellyfin these errors would come up in Caddy again and issue of URL not working would happen again after few minutes (10 to 20 mins)


Code:
ERR ts=1717736164.8409603 logger=http.handlers.reverse_proxy msg=aborting with incomplete response upstream=192.168.1.9:8096 duration=0.002019252 request={"remote_ip":"192.168.1.9","remote_port":"41620","client_ip":"192.168.1.9","proto":"HTTP/1.1","method":"GET","host":"<domain>.duckdns.org","uri":"/Videos/b7413af1fb4a3c24c1b4a6cf486f4718/stream.mkv?Static=true&mediaSourceId=b7413af1fb4a3c24c1b4a6cf486f4718&deviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjcuMSAod2luZG93cy14ODZfNjQgMTApfDE2Njg4Nzg3NzIzMzM1&api_key=<api_key>&Tag=7804b1af1b40fb6cf7b6d339629fdbec","headers":{"X-Forwarded-Proto":["https"],"X-Forwarded-Host":["<domain>.duckdns.org"],"Range":["bytes=2071919510-"],"X-Forwarded-For":["192.168.1.9"],"Icy-Metadata":["1"],"User-Agent":["JellyfinMediaPlayer"],"Accept":["*/*"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"","server_name":"<domain>.duckdns.org"}} error=writing: write tcp 192.168.1.9:443->192.168.1.9:41620: write: connection reset by peer

Jellyfin Server Docker: 10.9.6
Caddy Docker: v2.8.4
Clients: Jellyfin Media Player (Desktop), Findroid (Android)

Both of them are on Host Network


RE: Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - TheDreadPirate - 2024-06-07

So you are using your domain to access Jellyfin when on the same network? If so, go to your router's settings and see if there is an option for "NAT loopback" or "NAT hairpin" and enable it.


RE: Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - fedonr - 2024-06-10

Yes I'm using Caddy to give https URL to my local IP. And I can't find any such option in my router setting.


RE: Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - TheDreadPirate - 2024-06-10

Can you replicate the problem and then provide the full jellyfin log?

Also, do you know if your ISP uses CGNAT for your public IP?


RE: Jellyfin reverse-proxy with Caddy and Duckdns, throwing errors while streaming. - fedonr - 2024-06-10

Yes I'll try to replicate and get full logs.

For the ISP its CGNAT, so I use local IP with Duckdns and just get locally working URL with HTTPs, while for remote access I use Tailscale.