2023-09-19, 04:27 AM
(2023-09-18, 04:57 AM)bitmap Wrote: 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?
I'm trying to safely open it to the web with a domain name, I was just having an issue with the reverse proxy. I'm switching away from nginx though because I have discovered it is weird on Windows. I believe the issue I was having was that it was removing the port when it was proxy-ing to Jellyfin and automatically assuming port 80, which is always used by nginx in a manner that I cannot find a solution for on Windows, regardless of what it's set to in nginx.conf. If I had a linux machine I think it would've worked just fine. I'm looking into Caddy now.