3

This question is about managing/administering the software of a server in a business environment, so I hope it is not off-topic.

We plan to migrate some of our websites to Docker running on our Synology NAS. However, sites running in Docker have port numbers like 32153. We need to be able to map a specific domain to a specific port but have that appear as if the site is actually running on port 80 for HTTP and 443 for HTTPS.

For example, site1 may be running in docker under port 32100 and is accessible via http://10.0.0.1:32100. However, we want it to be accessible via http(s)://www.mysite1.com:80(:443).

Lastly, if possible, I'd like each of these sites to share the same IP address.

I considered configuring a reverse proxy, such as the IIS Rewrite module on Windows, but prefer a native system method if possible.

How would we enable this type of mapping in Synology or via standard Unix features?

If you

2 Answers 2

3

As it turns out, Synology has a built-in Reverse Proxy feature, which will allow one to map hosts and ports as I described in my question:

enter image description here

I'm sure there's a way to do all of this using the Unix CLI, but this solves my problem.

2
  • 1
    It'll solve your problem at least until the Docker container restarts, at which point it'll get a new ephemeral port...
    – womble
    Oct 6, 2018 at 0:50
  • @womble thanks for the tip. It appears one can use the -p param when starting the Docker image to solve this. Also, there is an option to specific a static port in the Docker software on Synology. Oct 9, 2018 at 12:50
2

Docker instances of nginx/apache run internally on port 80/443 but can be mapped to random port numbers on the host. Or you can map them to port 80/443. See the documentation: https://docs.docker.com/config/containers/container-networking/#published-ports

Also please share your configuration if you can't get something to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.