URL proxy like apps with Docker container

Discussion room for Docker, a lightweight virtualization application that gives you the ability to run thousands of containers created by developers from all over the world on DSM
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
burnersk
I'm New!
I'm New!
Posts: 5
Joined: Sat Nov 04, 2017 6:32 pm

URL proxy like apps with Docker container

Unread post by burnersk » Sat Nov 04, 2017 6:41 pm

I am using Docker (from "official" sources aka package center). I have some containers that expose ports I want to access.

I have setup DSM using a public domain and using ports 80 and 443.

I see that some applications seems to be mounted on different base urls. DSM is using "/" while e.g. Photo Station is using "/photo".

I would like to use "/mycontainer" to proxy the request from DSM to the internal port 13245.

The result should be as follows:
  • "/" opens DSM
  • "/photo" opens Photo Station
  • "/mycontainer" proxies internally to localhost:13245
Is this possible?
DS918+ (4GB RAM, 3x 3TB WD RED WD30EFRX-68EUZN0, RAID-5 with btrfs)

mightbetrue
Versed
Versed
Posts: 221
Joined: Sun Oct 02, 2016 9:41 am

Re: URL proxy like apps with Docker container

Unread post by mightbetrue » Sat Nov 04, 2017 9:17 pm

burnersk wrote:I am using Docker (from "official" sources aka package center). I have some containers that expose ports I want to access.

I have setup DSM using a public domain and using ports 80 and 443.

I see that some applications seems to be mounted on different base urls. DSM is using "/" while e.g. Photo Station is using "/photo".

I would like to use "/mycontainer" to proxy the request from DSM to the internal port 13245.

The result should be as follows:
  • "/" opens DSM
  • "/photo" opens Photo Station
  • "/mycontainer" proxies internally to localhost:13245
Is this possible?
The UI provides a feature in the application portal called reverse proxy.
This is where such a setting would be made, but the applyable rules are so simple, that only an incoming ip (of one of your interfaces) and port can be forwarded to another ip and port. Though, i am affraid that's not what you want.

On my root server, I do exactly that with nginx. Nginx is installed on dsm6, but either it acts as a "simple" server to serve web pages or a "stupid" reveres proxy that allows no fine tuning (if the reverse proxy in application portal is using nginx, not sure though). Using the UI there is no way to solve your problem.

You have to access the shell and get your hands dirty in order to takle the problem. Maybee someone in the underground moders or webstation forum solved it already? Did you searched there? Found a link that might describe how to do it: https://medium.com/@yann_ck/synology-le ... 89ed5e2f83.

Post Reply

Return to “Docker”