Hello,
Just wanted to start off by saying this is a great piece of software.
I’m looking to set the bind address to the loopback address (127.0.0.1 or localhost). Unfortunately I get the following when I use 127.0.0.1 or localhost as the bind address when I try to query the site in browser:
“Bad Request (Invalid host)”
Setting the bind address back to ‘*’ works but I want Sonarr to be only listening on the loopback address and I want it to be only accessible from the machine that is hosting Sonarr only and no where else. I’m running this on Ubuntu 15 with the latest released version of Sonarr. The version of Mono installed is the one included with the Sonarr repo. I have not tried installing a newer version of Mono (3.10 I think)
The logs show:
15-10-25 16:06:49.7|Info|OwinHostController|Listening on the following URLs:
15-10-25 16:06:49.7|Info|OwinHostController| http://127.0.0.1:8989/
15-10-25 16:06:49.7|Info|OwinHostController| http://localhost:8989/
15-10-25 16:06:49.8|Debug|OwinAppFactory|Attaching NzbDroneVersionMiddleWare to host
15-10-25 16:06:49.8|Debug|OwinAppFactory|Attaching SignalRMiddleWare to host
15-10-25 16:06:49.8|Debug|OwinAppFactory|Attaching NancyMiddleWare to host
So I know it is listening as expected. And using the browser does show the query is being received by the webserver and responding with the Bad Request message instead of the Sonarr content.
Netstat also shows:
Proto Recv-Q Send-Q Local Address Foreign Address State Timer
tcp 0 0 127.0.0.1:8989 0.0.0.0:* LISTEN off (0.00/0/0)
Let me know if I can provide more info to help resolve this bug. Setting the bind address back to * and accessing it through http://127.0.0.1:8989 works perfectly.
Thanks!
EDIT:
After some experimenting, I found using ssh port forwarding to remote machine that it seems to work. So I narrowed down to the fact Sonarr might not support Apache virtual hosts for reverse proxies. Seems to work with Couchpotato nzbget and other web hosted software. What I mean by virtual hosts is instead of url like example.com/sonarr, we do sonarr.example.com and reverse proxy to localhost:8989 (no need to set URL base in Sonarr). Reverse proxies allow access to ports open on loopback only. Again confirmed everything works when bind address is . The Sonarr web server doesn’t seem to like it if the URL is anything but the ip of the bind address if its not "" even if its proxied appropriately