Jellyfin Forum
Lost my Nginx config, can't get it it working again. - 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: Lost my Nginx config, can't get it it working again. (/t-lost-my-nginx-config-can-t-get-it-it-working-again)



Lost my Nginx config, can't get it it working again. - BB98 - 2025-01-21

I had Nginx set up and running on my Jellyfin server just to forward from port 80 to 8096.
I reset the VM it's all running on, and my configs got dumped somewhere along the way...

I know my previous config was extremely simple, but I can't seem to find the example I used.

Code:
server {
     listen 80;
     location / {
          proxy_pass http://localhost:8096;
     }

     location /socket {
     proxy_pass http://localhost:8096;
     }
}

This is what I currently have, but it isn't working internally, or externally.

Any help would be greatly appreciated.


RE: Lost my Nginx config, can't get it it working again. - TheDreadPirate - 2025-01-21

We have full examples in our documentation.

https://jellyfin.org/docs/general/networking/nginx/


RE: Lost my Nginx config, can't get it it working again. - BB98 - 2025-01-21

asdff


RE: Lost my Nginx config, can't get it it working again. - BB98 - 2025-01-21

Hey DreadPirate, thanks for the link. I did look at those before posting.
The examples don't really cover what anything in them is there for, and
all make the assumption that I am using SSL, which I am not.
I am thinking this line: "listen [::]:80;" is for IPv6, which I am also not using.
Are the header options mandatory to get it to work?

I threw the pertinent looking lines into my config, and it's still not working.
Forgot to mention the config is in /etc/nginx/sites-available and symlinked into /sites-enabled.

The new config with things added:

Code:
server {
  listen 80;
  listen [::]:80; #for IPv6?
  server_name domain.com; #hostname? domain? IP? Not sure which should be here.
                          #Am I wrong to assume that without this line, any packets set to this machine would
                          #Be forwarded to the proxy_pass host, regardless of what they were addressed to?
]

server {
  server_name domain.com
  client_max_body_size 20M;
  location / {
    proxy_pass http://localhost:8096;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Protocol $scheme; #What is the difference between these 2 lines?
    proxy_set_header X-Forwarded-Host $http_host;

    proxy_buffering off;
}

The access.log and error.log are both empty,
and I am still getting a "Connection Timed Out" message when I try to connect to the server on port 80.
I can connect using http://10.0.0.222:8096 and http://domain.com:8096

Thanks again.

(Don't mind the above post... I haven't used a forum in 20 years.)


RE: Lost my Nginx config, can't get it it working again. - TheDreadPirate - 2025-01-22

All of the "add_header" blocks are optional, but recommended. Even with http.

The example you provided has the "listen" lines in a separate server block.

There are HTTP examples that are collapsed as we try to encourage HTTPS.

https://jellyfin.org/docs/general/networking/nginx/#http-config-example

Click that to go to the http port 80 example and expand the code block.

You should be able to just copy and paste that example and just replace the server_name with your domain name and replace "jellyfin" with your jellyfin server's actual host name or IP. Looks like "localhost" would be what you change "jellyfin" to.

Code:
set $jellyfin localhost;