Reverse Proxy on NAS Synology

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
tchirou
Posts: 15
Joined: Wed Oct 01, 2014 8:05 am

Reverse Proxy on NAS Synology

Post by tchirou » Sun Jun 03, 2018 4:09 pm

Hi Evilhero

I have installed Mylar on my Synology with DSM 6.

I have set up a free let's encrypt certificate in DSM and set up reverse proxy config for all my apps (sabnzbd, sickrage, couchpotato, lazylibrarian, emby, plex) but the only one it does not work with is mylar. I just get a blank page with "502 bad gateway - nginx".

Would you have an idea about what to do ? It would be great to have tis for all packages.

Thanks a lot for your work on this

User avatar
evilhero
Site Admin
Posts: 2216
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Reverse Proxy on NAS Synology

Post by evilhero » Mon Jun 04, 2018 3:22 pm

tchirou wrote:
Sun Jun 03, 2018 4:09 pm
Hi Evilhero

I have installed Mylar on my Synology with DSM 6.

I have set up a free let's encrypt certificate in DSM and set up reverse proxy config for all my apps (sabnzbd, sickrage, couchpotato, lazylibrarian, emby, plex) but the only one it does not work with is mylar. I just get a blank page with "502 bad gateway - nginx".

Would you have an idea about what to do ? It would be great to have tis for all packages.

Thanks a lot for your work on this
I honestly haven't a clue in regards to reverse proxies - but I know of several people that use mylar with a nginx reverse proxy with no issues. You'd probably have to paste in your nginx.conf - as well as the relevant Mylar information (ie. what do you have your http_root set to within the config.ini, etc)

There might be some individuals that might be able to help if you provide some more information as to your setup.

tchirou
Posts: 15
Joined: Wed Oct 01, 2014 8:05 am

Re: Reverse Proxy on NAS Synology

Post by tchirou » Mon Jun 04, 2018 3:36 pm

It’s weird because mylar is kinda a fork of sickbeard right ?
And I had nothing to configure on each app, not even allowing https : the nas takes care of everything and redirects the https from the outside world on the http port of sabnzbd, sick rage, couchpotato, etc
Totally transparent by configuring the reverse proxy in DSM

User avatar
evilhero
Site Admin
Posts: 2216
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Reverse Proxy on NAS Synology

Post by evilhero » Mon Jun 04, 2018 3:42 pm

Actually Mylar is a fork of headphones, but the guts have been entirely changed out save for some small instances (the GUI remains simliar because I'm not really good at that stuff).

It sounds like if you don't have https enabled within Mylar, and you make sure you have your http_root set to the the correct value of your reverse proxy for mylar - it should work just fine. Again, without seeing your configs and setup, it's really hard to even just take a best guess (especially since I don't use a reverse proxy at all). You would only enable https if you're trying to push https on all fronts - the normal method is to let your web server handle the secure port stuff and leave the actual application running on a non-secure port, and let the server redirect.

barbequesauce
Posts: 12
Joined: Fri Feb 03, 2017 3:59 pm

Re: Reverse Proxy on NAS Synology

Post by barbequesauce » Mon Jun 04, 2018 3:45 pm

@tchirou - post your nginx configuration please, lets see if we can spot the issue.

Also the source of the page that shows the 500 error, so we can see if it's being returned by nginx or cherrypy.

tchirou
Posts: 15
Joined: Wed Oct 01, 2014 8:05 am

Re: Reverse Proxy on NAS Synology

Post by tchirou » Mon Jun 04, 2018 3:59 pm

Well I don't really have a configuration as everything is handled through the SYNOLOGY DSM GUI
I need to go dig through SSH to see if I can get something.

The source code of the page with the error is

Code: Select all

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

barbequesauce
Posts: 12
Joined: Fri Feb 03, 2017 3:59 pm

Re: Reverse Proxy on NAS Synology

Post by barbequesauce » Mon Jun 04, 2018 4:04 pm

That snippet made it clear - it's an nginx configuration issue. We'll need that file to get into the weeds here. Try looking at /etc/nginx/sites-available/main.

Also - we'll need to know what you have these variables set to in Mylar's config.ini:

[Interface]
https_chain
http_port
http_root
https_force_on
https_cert
http_host
enable_https
https_key
host_return

tchirou
Posts: 15
Joined: Wed Oct 01, 2014 8:05 am

Re: Reverse Proxy on NAS Synology

Post by tchirou » Mon Jun 04, 2018 4:23 pm

Well weirdly enough, there was someting in https_cert = / which caused for it not to work
Now it works

Thanks for you help !

Post Reply