Page 1 of 1

Reverse Proxy on NAS Synology

Posted: Sun Jun 03, 2018 4:09 pm
by tchirou
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

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 3:22 pm
by evilhero
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.

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 3:36 pm
by tchirou
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

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 3:42 pm
by evilhero
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.

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 3:45 pm
by barbequesauce
@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.

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 3:59 pm
by tchirou
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 -->

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 4:04 pm
by barbequesauce
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

Re: Reverse Proxy on NAS Synology

Posted: Mon Jun 04, 2018 4:23 pm
by tchirou
Well weirdly enough, there was someting in https_cert = / which caused for it not to work
Now it works

Thanks for you help !