[SOLVED] nginx reverse proxy

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
macnix
Newbie
Newbie
Posts: 2
Joined: February 2nd, 2012, 5:32 am

[SOLVED] nginx reverse proxy

Post 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
}
Last edited by macnix on February 2nd, 2012, 6:43 pm, edited 1 time in total.
macnix
Newbie
Newbie
Posts: 2
Joined: February 2nd, 2012, 5:32 am

Re: nginx reverse proxy

Post 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;
  }                                           
}                                             
Post Reply