SABnzbd

Wiki

Incorrect or missing information? How to hide SABnzbd behind a webserver

Assuming the server is already running correctly and SABnzbd is running on http://localhost:8080.

Apache 2

Required modules: proxy.load and proxy_http.load

The following goes in Apache's httpd.conf file.
For Linux: /etc/apache2/httpd.conf and for Windows: C:\Program Files\Apache2.2\conf\httpd.conf.

<Location /sabnzbd>
order deny,allow
deny from all
allow from all
ProxyPass http://localhost:8080/sabnzbd
ProxyPassReverse http://localhost:8080/sabnzbd
</Location>

Note on Apache 2.4 Config files for a2enmod and proxy proxy_http are located in: /etc/apache2/sites-available/000-default.conf (for HTTP) and *ssl*.conf (for HTTPS).

Nginx

The following files go in the nginx conf.d directory /etc/nginx/conf.d/.

ssl.conf

ssl_certificate      /etc/pki/tls/certs/example_com.crt;
ssl_certificate_key /etc/pki/tls/private/example_com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

proxy.conf

client_max_body_size 10m;
client_body_buffer_size 128k;

#Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# Advanced Proxy Config
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;

# Basic Proxy Config
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_buffers 32 4k;

sabnzbd.conf

upstream SABnzbd {
server localhost:8080;
keepalive 512;
}

upstream sickbeard {
server localhost:8081;
keepalive 512;
}

server {
listen 80;
listen 443 default ssl;
server_name example.com;

access_log /var/log/nginx/sabnzbd-access.log;
error_log /var/log/nginx/sabnzbd-error.log debug;

if ( $scheme = http )
{
rewrite ^ https://$server_name$request_uri? permanent;
}

include /etc/nginx/conf.d/ssl.conf;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

location /sabnzbd {
include /etc/nginx/conf.d/proxy.conf;
proxy_pass http://localhost:8080/sabnzbd;
}

location /sickbeard {
include /etc/nginx/conf.d/proxy.conf;
proxy_pass http://localhost:8081;
}

location /nginx_status {
stub_status on;
access_log off;
}
}