Reverse NGINX SiCKRAGE without proxy


#1

Hi,

I recently updated sickrage and it provoqued a total corruption of it.
Then I had to install it from scratch.
Then I noticed that the user interface is different and there is now a SSO connexion.

The problem is that my previous nginx revers DNS (in order to access sickrage, couchpotato and so on) is not working anymore.

What shoud I do to make my reverse dns working with the SSO process?

Thanks.

SR Version:

9.4.4

SR Install Type:

GIT

SR GIT Commit:

dcb10ca58166f24a82ebe65fadb05185b7de8c0d

SR Username:

[email protected]

SR Locale:

UTF-8

SR Config File:

/opt/sickrage/config.ini

SR Cache Dir:

/opt/sickrage/cache

SR Log File:

/opt/sickrage/logs/sickrage.log

SR Arguments:

[’-q’, ‘–daemon’, ‘–nolaunch’, ‘–pidfile=/home/pi/.sickrage.pid’, ‘–datadir=/opt/sickrage’]

SR Web Root:

/sickrage

Tornado Version:

4.5.2

Python Version:

2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]

Kind regardes,
Orlando


#2

Did you read the nginx reverse how-to on the forums ?


#3

Of course. Did not see without proxy.


#4

Well following that guide I created works perfectly with SSO


#5

Hi echel0n,

You probably think I’m a dumb boy, but please be aware that I tried many ways.
Is there a way to remove SSO and keep the old way to auth without beeing redirected to sickrage.ca site?
If not, and I allready have a NGINX set up for other tools, it is more complicated. The topic you talk about is based with only one thing running with the rasp: sickrage, which is not my case.

So if you could me more helpful than “for me it works” I would appreciate.

Thanks.


#6

If you can provide you NGINX config so I can see how its setup and test on my end that would be more helpful


#7

Sure.
I followed post [ How to setup a reverse NGINX proxy for SiCKRAGE
In all following i changed my domain name with xxx.

In /etc/nginx/sites-enabled/ I allready have my reverse file:
I put in comment the sickrage part:

server {
listen 80;
server_name xxx 192.168.0.6;

location / {
index index.php index.html;
}

location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}

#location /sickrage {

proxy_pass http://127.0.0.1:8081;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

location /sonarr {
proxy_pass http://127.0.0.1:8989;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /couchpotato {
proxy_pass http://127.0.0.1:5050;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /transmission {
proxy_pass http://127.0.0.1:9091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /monitor {
root /usr/share/nginx/html/ezservermonitor;
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}

}

then in I created the file
create a new file called sickrage under /etc/nginx/sites-enabled/ and add the following code

upstream sickrage {
server localhost:8081;
}

server {
listen 80;
server_name xxx;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name xxx;
ssl_certificate /etc/nginx/ssl/sickrage.crt;
ssl_certificate_key /etc/nginx/ssl/sickrage.key;

location /sickrage {
proxy_pass http://sickrage;
proxy_set_header Host $http_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 $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}

I executed the commands:
Make a directory called ssl under /etc/nginx then create SSL certs using the following command openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/sickrage.key -out /etc/nginx/ssl/sickrage.crt

I wonder if there is a conflict between the reverse file and the new one put in place…


#8

in the reverse file, i copiedbut each line of /sickrage part has a sharp before to put it in comment in the file.


#9

Hi,

Any idea then how to keep reverse with couchpotato, motion and other stuff + sickrage with new SSO login functionality?

Cheers,
Orlando


#10

Did you have the chance to take a look?


#11

Hi,

Trying to perform similar behavior. How to make sickrage work with couchpotato, sonarr, transmission and Kodi ?

Cheers,
Sylphide.


#12

Did you read our how-to on this yet ?


#13

Hi,

As I have the same goal than SyLphIdE,

In the post https://forums.sickrage.ca/t/how-to-setup-a-reverse-nginx-proxy-for-sickrage/321 it is explained to perform a reverse DNS for sickrage.

Is it compatible with the fact of having a file /etc/nginx/sites-available/reverse with inputs like reverse dns for couchpotato cohabiting and /etc/nginx/sites-enabled/sickrage file ?

Moreover, my server is like mydomain.hd.fr
To go to couchpotatoe, simple : https://mydomain.hd.fr/couchpotato

In the post it is explained that for sickrage it should be https://sickrage.mydomain.hd.fr is it correct ?
Because it is not working for me, and enabling /etc/nginx/sites-enabled/sickrage crashes my all nginx server:

image


#14

I personally run the app behind a nginx server using /sickrage to point to my install, I’ll provide you the config details later tonight.


#15
upstream sickrage {
  server localhost:8081;
}

server {
  listen 80;
  server_name somedomain.com;

  location /sickrage {
    proxy_pass http://sickrage;
    proxy_set_header    Host                $http_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   $scheme;
    proxy_buffer_size     128k;
    proxy_buffers            4 256k;
    proxy_busy_buffers_size    256k;
  }
}

#16

Was simple then, you have to use the existing reverse file and add at the beginning:

upstream sickrage {
  server localhost:8081;
}

and after other locations as couchpotatoe add

  location /sickrage {
    proxy_pass http://sickrage;
    proxy_set_header    Host                $http_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   $scheme;
    proxy_buffer_size     128k;
    proxy_buffers            4 256k;
    proxy_busy_buffers_size    256k;
  }

Thanks that’s the confusion I had I thought that i had to create new reverse file…


#17

Exactly what I needed. So I have to put it in all the same file ! Thanks madjo1983 and echel0n for all those precious tips !