2023-09-18, 04:57 AM
A few things I see here. First, make sure you don't have any duplicate declarations in your nginx.conf. I see a few that might be the case, namely proxy_http_version. Some of the other headers might get set there as well, but those won't cause panic responses. That one will.
Second, you have two root location blocks...is there a reason for that? I'm not an nginx whiz, quite the opposite, but I'm fairly certain you can only have one block and all your directives have to go under that single location. Right now, you have two. That won't work. I also have no idea why you have the block returning 302 when it should be set to proxy_pass instead. I'd comment out this first root location block entirely as it doesn't appear to serve a purpose (unless it's functioning a way I don't know of, which is entirely possible).
Next, depending on how your RP and your container are hosted, you need to consider how your directives are sending traffic. For instance, proxy_set_header Host $host won't work right if your RP is in a container not in host network mode. I see you have set $jellyfin jellyfin which indicate this might be a containerized setup, but I've had issues using names, so you might try the IP address of the host machine (not localhost or 127.0.0.1).
Lastly, I'm confused...why are you setting up nginx? I don't believe you can use localhost/127.0.0.1 as your domain name, not to mention there wouldn't be a reason to do so. Just note the IP of the computer. On the same computer, you could use "localhost", on any other machine, use its local IP address (e.g., 192.168.1.xxx). Reverse proxy shouldn't be necessary inside your own network...again, unless I'm missing something here -- but I'm *fairly* confident, at least, that you can't set this up so "localhost" redirects to your Jellyfin server.
I think the question I'm left with after trying to help you solve this and then re-reading a few times is...what are you trying to accomplish?
Second, you have two root location blocks...is there a reason for that? I'm not an nginx whiz, quite the opposite, but I'm fairly certain you can only have one block and all your directives have to go under that single location. Right now, you have two. That won't work. I also have no idea why you have the block returning 302 when it should be set to proxy_pass instead. I'd comment out this first root location block entirely as it doesn't appear to serve a purpose (unless it's functioning a way I don't know of, which is entirely possible).
Next, depending on how your RP and your container are hosted, you need to consider how your directives are sending traffic. For instance, proxy_set_header Host $host won't work right if your RP is in a container not in host network mode. I see you have set $jellyfin jellyfin which indicate this might be a containerized setup, but I've had issues using names, so you might try the IP address of the host machine (not localhost or 127.0.0.1).
Lastly, I'm confused...why are you setting up nginx? I don't believe you can use localhost/127.0.0.1 as your domain name, not to mention there wouldn't be a reason to do so. Just note the IP of the computer. On the same computer, you could use "localhost", on any other machine, use its local IP address (e.g., 192.168.1.xxx). Reverse proxy shouldn't be necessary inside your own network...again, unless I'm missing something here -- but I'm *fairly* confident, at least, that you can't set this up so "localhost" redirects to your Jellyfin server.
I think the question I'm left with after trying to help you solve this and then re-reading a few times is...what are you trying to accomplish?
Jellyfin 10.10.0 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage