Saturday, October 10, 2015

Reverse proxy for sonarr

First, on my home PC which is hosting sonarr - I'll restrict access to PCs on my LAN and the VPS.
iptables -I INPUT -p tcp -s VPS_IP --dport 8989 -j ACCEPT
iptables -I INPUT -p tcp -s 192.168.1.0/24 --dport 8989 -j ACCEPT
iptables -I INPUT -p tcp -s 127.0.0.1 --dport 8989 -j ACCEPT
iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 8989 -j DROP
Forward 8989 to PC running sonarr in router.



On vps in apache default site:

ProxyPreserveHost Off
ProxyPass /sonarr http://HOME_PC:8989/sonarr
ProxyPassReverse /sonarr http://HOME_PC:8989/sonarr

Also had to set settings->general-> URL Base in sonarr.


Make sure to enable authentication, either via sonarr or apache. I used form login.

<Proxy z>
AuthFormProvider file
    AuthType form
    AuthName "Login Required"
    Session Off
    SessionCookieName session path=/
    require valid-user
  # This is the login page
   ErrorDocument 401 /auth.html
           # This is the file containing users login data
   AuthUserFile /etc/apache2/.htpasswd
</Proxy>



No comments:

Post a Comment