SSL + Caddy (reverse proxy) - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Support (https://forum.jellyfin.org/f-support) +--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting) +---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access) +---- Thread: SSL + Caddy (reverse proxy) (/t-ssl-caddy-reverse-proxy) |
SSL + Caddy (reverse proxy) - DingleBob - 2024-06-26 Hey everyone, Jellyfin itself works and I have been using it from outside through wireguard VPN and it works great. I want to improve accessibility for friends, so I decided I will give port forwarding a try. This is my setup right now Domain (cname) > dynamic DNS (duckdns.org) > my local network which does port forwarding (fritzbox) > caddy (as suggested in jellyfin docs) as reverse proxy (on a raspberry pi) > jellyfin (running on trueNAS) Since port forwarding poses risks, I definitely don't want to do it without SSL. So I ran certbot (lets encrypt) on my raspberry pi. Certbot requires ports 80 (http) and port 443 (https) in order to do its job and provide the certificates. For that purpose, I set temporary port forwarding for 80 & 443 from my fritzbox to my raspberry pi. this worked and I was able to create the certs. After I obtained the certs, I created the .p12 file. Then I created a new dataset on my trueNAS which only contains the SSL cert. I created a mountpoint for the jellyfin jail and then set up HTTPS in the jellyfin dashboard -> network settings (using jellyfin's default https port: 8920). I also set the path to the .p12 file and entered the cert password that I had set up when I generated the .p12 file. So far so good, I managed to do all the steps that I had planned. My port forwarding is set up in this way: I call my domain with ":8920" ending -> this goes to the fritzbox. fritzbox has forwarding for :8920 -> caddy. caddy does reverse proxy -> jellyfin:8920 This is what my Caddyfile looks like (replaced domain and ips with placeholders): Code: { When I run caddy with this configuration, it receives the hit from my call to my domain (with :8920) but it seems like it doesn't go further (doesn't hit jellyfin it seems) This is the caddy log (I replaced domain names and ips with placeholders): Code: 2024/06/26 07:38:55.951 ERROR http.log.error dial tcp <ip of my jellyfin>:8920: connect: connection refused Can someone help me and point me into a direction or give me advise on what to try next or what to look for? I'm not an expert when it comes to networks and I'm already proud of how far I gotten on my own, but I feel like I've reached my limits. RE: SSL + Caddy (reverse proxy) - DingleBob - 2024-06-26 ahahahaha I just fixed it, it was so simple! when using caddy to handle the SSL, I don't need to add anything SSL related to jellyfin. I changed my caddyfile to point to jellyfins http port and it works now! caddy handles the SSL! this also makes maintenance easier, as I just have to renew the cert on the raspberry pi and not change anything on my NAS. fuck yeah!!! 🤘🏾😎 RE: SSL + Caddy (reverse proxy) - DingleBob - 2024-06-27 I have follow-up questions, maybe someone can help me:
RE: SSL + Caddy (reverse proxy) - TheDreadPirate - 2024-06-27 Script kiddies aren't going to spend the time to scan EVERY port. They scan common service ports, scan a couple random ports, then move on. My router logs these blocked accesses so I can confirm this is how they typically behave. IMO, I'd stick with a custom port (that's what I do). As for indexing, robots.txt is the usual answer. https://stackoverflow.com/questions/6502085/whats-the-best-way-to-stop-search-engines-indexing-my-login-pages RE: SSL + Caddy (reverse proxy) - DingleBob - 2024-06-28 thanks!!! I just looked into this and it seems that jellyfin already comes with a working robots.txt: https://github.com/jellyfin/jellyfin-web/blob/master/src/robots.txt I checked on my domain, adding /robots.txt to the request and I receive it with the wildcard and disallowing from root. all good then! 👌🏾 thanks dreadpirate for your time and help! 🙏🏾 |