Nginx Reverse Proxy error

I’m trying to get a Nginx reverse proxy set up. I have sabnzbd and couchpotato running quite fine under it and they pass SSL properly. Sonarr however is not functional.

Is what I’m recieving from error.log in Nginx.

location /sonarr { proxy_pass http://127.0.0.1:9898; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

That’s my nginx.conf for sonarr. I have the base url set to /sonarr as well. Anyone have an idea as to what the problem is? I’m stumped. Everything seems functional for Sabnzbd and Couchpotato, not sure why Sonarr is being odd man out.

Duder123,

Try this… this works perfect on my nginx setup:

location /sonarr {
proxy_pass http://192.168.1.5:8989; <-- my real ip, don’t use localhost
proxy_set_header Host 192.168.1.5:8989; <-- set the header to the IP or it caused issues somewhere
}

It could be it’s just your port. Sonarr is 8989 (default) not 9898

I’m not connecting to this via local network so some form of “localhost” would have to apply. The port isn’t the issue, I’ve set it to both 8989 and 9898. I’m thinking it’s related to SSL. I have Nginx redirecting all http traffic to https.

is nginx running on the same server as Sonarr? If not, you have to use the IP address.

Check your bindings in sonarr, and make sure it’s 0.0.0.0 (or the actual IP address - 0.0.0.0 just binds to all, including localhost) and not localhost only (if like I mentioned ^ the two are running on separate servers).

SSL should be handled by the nginx ssl-offload. Make sure you don’t have SSL enabled in Sonarr.

fyi:

Here’s my sonarr config (the /drone is because that’s what I call it from nzbdrone days):

I figured this out when I loaded it into a GUI based text editor rather than vim. There is only a single space between the word location and /sonarr. Changing it to

location /sonarr fixed it.

I throw my hands up on this one. It actually requires it to be double spaced. It would be nice if the error explicitly told you that it was a typographical error rather than what appears to be bad HTTP handling.

Thanks for the help but it was really the most mundane of solutions and something I should have noticed earlier. Fortunately someone else will be able to find this thread via google.

Odd… maybe in sonarr you got a double-space… mine doesn’t have that issue :slight_smile:

-LJ

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.