Page 1 of 1

[SOLVED] nginx reverse proxy

Posted: February 2nd, 2012, 5:42 am
by macnix
The reverse proxy is working fine, except that sabnzbd keeps redirecting to HTTP and adding /sabnzbd to the URI. Anyone got this working properly with nginx?

I'm running sabnzbd 0.6.14 with HTTP port 8080 & HTTPS disabled.

If I enable HTTPS port 9090 and proxy all requests to it, it times out.

This is my current nginx sabnzbd reverse proxy config:

Code: Select all

upstream sabnzbd {
  server 127.0.0.1:8080 fail_timeout=30s;
}

server {
  listen 443;
  server_name sabnzbd.domain.com;

  location / {
    allow 1.1.1.1;
    deny all;
    proxy_redirect off;

    rewrite ^(.*)$ /sabnzbd$1 break;
    proxy_pass http://sabnzbd;
  }

  # SSL directives
}

Re: nginx reverse proxy

Posted: February 2nd, 2012, 6:42 pm
by macnix
To answer my own question, there was nothing wrong with that config. I only had to add an http vhost which would redirect everything to https:

Code: Select all

server {                                      
  listen 80;                                  
  server_name sabnzbd.domain.com;              
                                              
  location / {                         
    rewrite ^ https://$host$request_uri break;
  }                                           
}