Jellyfin Forum
Remote access problems using Nginx and Cloudflare. - 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: Remote access problems using Nginx and Cloudflare. (/t-remote-access-problems-using-nginx-and-cloudflare)



Remote access problems using Nginx and Cloudflare. - Cadmoon - 2024-01-27

Hi guys, I'm having some issues getting remote access up and running on my server. 
Whenever I try to connect to my domain that is reverse proxied to my server via Cloudflare I get a 502 (bad gateway) error. Everything indicates a server side error but I can't figure out where. 

Some info on my current setupand what I have done so far: 
Running Jellyfin and Nginx as dockers on Unraid
I have contacted my ISP and had them remove me from CGNAT and unblock ports from their end
I have opened ports 80 and 443 on my router and forwarded them to Nginx's internal IP 
I set up DNS records in Cloudflare to direct my domain to my IP and have set the provided nameservers with my domain registrar 
I have set up the redirects for my domain to my internal jellyfin IP and port in Nginx, using http, and attached an SSL cert generated with Nginx 

Anything standing out that I missed or may have configured wrong? As a trial I set Nginx to direct my domain to a 404 host and this seemed to work, at least in that I got shown a generic 404. 

If anyone needs any other info to help out please let me know. 

Thanks


RE: Remote access problems using Nginx and Cloudflare. - TheDreadPirate - 2024-01-27

Can you share your nginx config with us via sourcebin? Censor you domain name.


RE: Remote access problems using Nginx and Cloudflare. - Cadmoon - 2024-01-27

Hey mate, hopefully this if the particular config file you're requesting. If not please let me know which one you're after and I'll do my best to find it.
https://srcb.in/JJqBxcT8tc

Thanks for your help.


RE: Remote access problems using Nginx and Cloudflare. - TheDreadPirate - 2024-01-28

Is this the right config? I don't see any of the proxypass settings for Jellyfin.


RE: Remote access problems using Nginx and Cloudflare. - Cadmoon - 2024-01-28

It is likely the wrong config file, I had trouble locating any of them within Unraid.

I have however fixed the issue. If anyone else stumbles on this looking for a solution what I had wrong was using the default ports in Nginx of 80 and 443, these ports are used by Unraid to remote access the server. My fix was to set the ports in Nginx to something else and then set my router port forwarding to direct traffic to those ports instead.