Jump to content

Ports in reverse proxy setup with http to https redirect


LiaraAlis

Recommended Posts

LiaraAlis

Hi together,

 

I'm using emby on my Synology DiskStation. There I configured Emby to handle remote connections from the reverse proxy and configured the local port to 8097.

5eba6c1ef3668_20200512_1127.png

5eba6c26c7d9d_20200512_1127_001.png

 

In DSM I configured the reverse proxy:

 

5eba6bbef382f_20200512_1125.png

 

In the web station I configured a virtual host for the redirect to https:

5eba6c63036a4_20200512_1128.png

 

Now I suggested to use Emby in our shop as well and wanted to do the configuration there as well. Unfortunately, both the Reverse Proxy and Web Station now tell me that the ports are already in use by another application, even though I changed the ports in Emby. On my DiskStation at home it works without any problems with the configuration above.
Also netstat shows me that the ports are not used. So why does this not work anymore? Was there any change in Synology Package regarding this?
 
I appreciate any help in this topic.
 
Regards,
Alexander
Edited by LiaraAlis
  • Like 1
Link to comment
Share on other sites

Hi, I would leave the Emby local port at default, then just change the public port to forward to the local port. Please let us know if this helps. Thanks.

Link to comment
Share on other sites

LiaraAlis

Hi, I would leave the Emby local port at default, then just change the public port to forward to the local port. Please let us know if this helps. Thanks.

 

I changed the domain name for emby and configured the default http/https ports in the reverse proxy to forward them to the local emby ports.

But I don't understand, why the above is working on my own nas, but not in the shop?

 

And it is very annoying, that the "Emby server" app link in the DSM menu is not working because it uses the default port and there is no possibility to change the address and port for this link…

 

post-575561-0-01537100-1589796927_thumb.png

Edited by LiaraAlis
Link to comment
Share on other sites

FrostByte

Sorry, I've never set up external connections or had the need to change ports so really have no idea.   

 

The only thing I've changed in that area was to reserve my NAS secondary LAN IP on my router and inserted that in the "local IP address" in Emby to force everything out that IP.  However, my Emby link in DSM works after NAS reboot since no port change and I'm not using external IPs

 

http://media-server:8096/web/dashboard.html

Edited by FrostByte
Link to comment
Share on other sites

LiaraAlis

Unfortunately, this is not the solution. Because we are always connecting with the external address to DSM and only use HTTPS. But the link is only working for the HTTP port. And as mentioned above I have to use a reverse proxy for the ssl certificate. And because for some reason I can't use the default ports. I used a second domain with the default http(s) ports. It should be possible to configure the url and ports of this link.

Link to comment
Share on other sites

Seger

Hey hey :)

 

maybe I can help you, but I don't quite understand the problem yet. Or maybe in other words, I understand what the target is but I don't yet understand from which port and DDNS address the server should be accessed. I also don't understand why a vhost is created, in DSM you can click in the settings to redirect the HTTP requests to HTTPS. An additional redirection via WebStation is normally not needed.

 

Could you please do me a favor and set 4 different port numbers in Emby, so that you have a better overview. Afterwards please upload a photo. Then please delete the VHost once and upload a photo from Reserve Proxy afterwards? I saw that you didn't enter a * in the Reserve Proxy and Hostname fields, this is just an example photo or is that what you wanted? For Hostname the hostname must be pure and for the Proxy Server also.

I saw from the screenshots that you speak German, let's switch for a moment, so I can answer faster. Alternatively gladly also by PN.

 

 

 

Many greetings,

Seger

Link to comment
Share on other sites

LiaraAlis

Hi,

 

as suggested I will switch to German, to explain it. ;)

 

---

 

Erst einmal danke für die Antwort. Die Screenshots oben sind mittlerweile veraltet und wir reden hier auch von aktuell zwei Konstellationen, auf die ich gerne kurz eingehe, damit es klarer wird:

  • Die Emby-Installation auf meiner privaten DS718+:
    • Aktuell läuft hier Emby selbst lokal auf Port HTTP 8097 und HTTPS 8920, Öffentlich ebenso.
    • Der Ein Reverse-Proxy horcht auf https://<hostname>:8920 und liefert http://localhost:8097 aus (es war früher mal *:8920, ist aber mittlerweile auf den Hostnamen geändert)
    • Die Umleitung von http://<hostname>:8096 auf https://<hostname>:8920 erfolgt hier über einen vHost über die Webstation. Damit funktioniert auch der Link im DSM-Menü.
      Die in DSM eingestellte Umleitung auf HTTPS verweist sonst auf den https-Port vom DSM und nicht auf Emby – logisch, woher soll er den Port wissen? Daher ist dieses Konstrukt hier notwendig. Das ganze funktioniert auch problemlos über sämtliche Emby-Apps.
       
  • Die Emby-Installation auf der DS918+ in dem Ladengeschäft meines Minijobs
    • Eigentlicher Plan war, meine Konstellation von meiner eigenen DS nachzustellen. Dummerweise funktioniert das nicht, da ich die Fehlermeldung erhalte, dass die Ports 8096 und 8920 vergeben sind (sowohl in der WebStation als auch im Reverse Proxy) – selbst dann, wenn ich diese in Emby ändere und das Paket neu starte. Diese Meldung erhalte ich auf meiner eigenen DS bis heute nicht. Merkwürdig.
    • Daher entschied ich mich um das Problem in den Griff zu bekommen, einen neuen Host zu nehmen und diesen unter den Ports HTTP 80 und HTTPS 443 zu betreiben, was für die anderen Mitarbeiter auch einfacher ist, einfach eine Adresse einzugeben, statt sich auch noch einen Port zu merken.
    • Dadurch funktioniert allerdings nun der Link im DSM nicht mehr, der Server sendet keine Antwort. Ich kann wie eben erwähnt auch weder die WebStation noch den Reverse-Proxy drauf hängen, selbst wenn ich in Emby die Ports ändere.

Unterm Strich kommt raus, dass ich mir wünschen würde, dass man den Link im DSM konfigurieren kann, sodass dieser sowohl im lokalen auch externen Zugriff funktioniert. Dann wäre das ganze deutlich einfacher zu handhaben – ein Link der nicht funktioniert, halte ich nämlich für extrem unelegant. ;)

Ich hoffe, ich konnte so Licht ins Dunkel bringen.

 

Viele Grüße,
Alexander

Link to comment
Share on other sites

Seger
Okay, let me get this straight.

 

You've got the port forwarding sorted out for you now. And you would like to be linked via DSM using the corresponding icon.

 


This is actually not quite cleanly solved at Synology. The file: /volume1/@appstore/EmbyServer/ui/config would need to be adjusted. 



{
".url": {
"Media.Emby.Server.Instance": {
"title": "Emby Server",
"desc": "Emby Server Web UI",
"icon": "images/EmbyServer_{0}.png",
"type": "url",
"protocol": "http",
"port": "8096",
"url": "/web/dashboard.html",
"allUsers": true
}
}

Currently, the Dashboard always redirects to the default port, no matter what settings are selected, or am I missing something?

 

Thanks and best regards,

Seger

Link to comment
Share on other sites

The port number is set in the Synology manifest at build time, so that's why it really should be left at default.

Link to comment
Share on other sites

Seger

Okay, but in other words, this means that the link in DSM remains without function (if other port numbers are selected in the settings). At the moment, the Config file points to the individually set domain Beispiel.de and the default port number 8096 (Example.de:8096). In the dashboard (Emby Settings) the individual domain and the individual port number is shown.

 

I don't want to recommend something that will cause problems later, but the config file should be adapted. But as soon as Reserve Proxy is used, it is no longer necessary anyway, because then Emby cannot know the individual port. But without Reserve Proxy I would have suspected that the link has a function (if you change the ports).

 

@@LiaraAlis the workaround is in the file, did you understand it so far? If it is so important to you that you or your friends want to go over the link, then you just have to change the file manually. I never used the icon myself, because I access Emby via Wildcard Domain: Emby.Beispieldomain.de /so direct address to the login screen.

 

Have a nice week!

Seger

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...