Linux Problem with NGINX and SABnzbd
#1
Hey all,
I have reverse proxy's working for sickrage and couchpotato, they work fine with their respective webroots, however I can't get sabnzbd to work. It'll show the admin user/pass window, then just direct me to http://localhost:8080/sabnzbd instead of returning the sab interface (sab is on a server, not the computer I'm on).

Here are my nginx settings:

/etc/nginx/proxy_params:
Code:
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

/etc/nginx/sites-enabled/www:
Code:
#ALL THE DEFAULT STUFF THEN
location /sab {
                include /etc/nginx/proxy_params;
                proxy_pass http://localhost:8080;
        }

So I think I need the equivalent of webroot for sab, as couch and sickrage work with this exact same setup. Anyone have any ideas or alternatives?

Thanks
Niietzshe
Reply
#2
I'll show you how I have mine.

First, I'm using SSL, because I have mine open to the internet. It can be reached at https://sabnzbd.xxxxx.com

I'm using some global files because I have many subdomains setup for couchpotato, sickbeard, etc.

It took me a while to set this all up properly so I thought I would share. also, if anyone has any comments please ask. I know my setup might not be perfect.

Also, if using SSL make sure to turn on HTTPS support within the sabnzbd config settings.

Code:
server {
  listen            80;
  listen            443 ssl spdy;
  server_name       sabnzbd.xxxxxx.com;
  include           /usr/local/etc/nginx/global.d/http.conf;
  include           /usr/local/etc/nginx/global.d/ssl.conf;  

  location / {            
    set                 $mobile_location /m;
    include             /usr/local/etc/nginx/global.d/mobile.conf;
    include             /usr/local/etc/nginx/global.d/proxy.conf;
    proxy_pass          https://127.0.0.1:8080;
    proxy_redirect      http:// https://;
  }

  location /m {
    include             /usr/local/etc/nginx/global.d/proxy.conf;
    proxy_pass          https://127.0.0.1:8080/m;
    proxy_redirect      http:// https://;
  }
}

and my proxy.conf
Code:
# 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;

add_header                      Front-End-Https    on;
add_header                      Cache-Control "public, must-revalidate";
add_header                      Strict-Transport-Security max-age=15768000;

http.conf
Code:
# redirect to https

if ( $scheme = http ) {
  return 301 https://$server_name$request_uri;
}

and ssl.conf
Code:
ssl                             on;
ssl_certificate                 /usr/local/etc/nginx/certs/self-ssl.crt;
ssl_certificate_key             /usr/local/etc/nginx/certs/self-ssl.key;

ssl_protocols                   SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers                     ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_prefer_server_ciphers       on;
ssl_session_cache               shared:SSL:10m;
ssl_session_timeout             10m;
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#3
Thanks for the reply, it'll be very useful when I go to setup ssl as well (I've generated the certs, just need to hook it up after I have http working).

The thing is, I think it's Sab that's the issue. I have exactly the same setup for couch and sick and they work fine. Sab in fact will show the login screen before returning an incorrect address, so that first bit works. Is there anything in sab that I should set similar to webroot? I tried changing the host from 0.0.0.0 to localhost last night thinking that might do it (as nginx is pointing at localhost:8080), but no bananana.

I'll have a go tonight again.
N
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with NGINX and SABnzbd0