docker-gen icon indicating copy to clipboard operation
docker-gen copied to clipboard

Feature request : Ability to serve other ports than 80 or 443

Open afillatre opened this issue 9 years ago • 1 comments

My problem is the following: I'm using Spring Boot Applications in Docker containers, successfully exposed through the 80 and 443 ports with nginx-proxy. This works very well, but I need more :)

Spring boot app can expose 2 more ports, each : a management port, and a debug port.

I'd like to be able to expose those 2 ports, as well as the common one, through nginx-proxy. What I actually need is the reverse-proxy capability, so I can a have unique DNS for my container, and access multiple ports from it.

For explanation' sake, that would enable me to:

  • use the same port for multiple applications (has they're not directly exposed to the host
  • avoid having to manually map all needed ports to the host
  • keep my firewall rules simple (only 3 ports to open for all the application, rather than 3 for each)

I hope that's clear enough. One way to do that in the container configuration would simply be to have something like:

[environment]
VIRTUAL_HOST: bar.foo.com
VIRTUAL_PORTS:
  - "443:8080"
  - "18080:18080"
  - "18000:8000"

Then, the following URL could be used and point to the right container:

  • https://bar.foo.com : external port 443 -> internal port 8080
  • https://bar.foo.com:18080 : external port 18080 -> internal port 18080
  • https://bar.foo.com: 18000 : external port 18000 -> internal port 8000

afillatre avatar Oct 20 '16 21:10 afillatre

This actually related to #173

afillatre avatar Oct 22 '16 08:10 afillatre

Handled by nginx-proxy since https://github.com/nginx-proxy/nginx-proxy/pull/2434

buchdag avatar May 16 '24 12:05 buchdag