acme-companion icon indicating copy to clipboard operation
acme-companion copied to clipboard

Cannot access to the assigned docker container port

Open farhadmammadli opened this issue 4 years ago • 3 comments
trafficstars

Hi! Read the documentation carefully, but unfortunately could not found a way to assign any custom port. Basic-usage

How to assign custom http port to a container on run command? Traditional "docker run -p 8080:80 ..." syntax does not forward proxy to the app, so cannot access from the https://sub.domain.com:8080. However, I can access the app just by visiting https://sub.domain.com.

farhadmammadli avatar Mar 09 '21 22:03 farhadmammadli

Hi.

nginx-proxy isn't really meant to work with different published ports on a per proxied container basis.

You can publish the 80 and 443 ports of the nginx-proxy container to different ports on the host (let's say 8080 and 8443), but then you won't be able to use the companion as the http-01 challenge used to validate your ownership of the domains you request certificate for won't work over anything else than default 80/443 ports, and there isn't anything we can do to bypass this.

buchdag avatar Mar 12 '21 13:03 buchdag

Thanks for the reply, so I need another (sub)domain if I wanna serve any other dockerized web app? What about support of path like https://sub.domain.com/app1 or https://sub.domain.com/app2

farhadmammadli avatar Mar 13 '21 08:03 farhadmammadli

Thanks for the reply, so I need another (sub)domain if I wanna serve any other dockerized web app?

Yep, that's how nginx-proxy is meant to be used. If want to serve three different dockerized apps on the same host, you'll need three different (sub)domains.

What about support of path like https://sub.domain.com/app1 or https://sub.domain.com/app2

That's currently not supported.

buchdag avatar Mar 13 '21 21:03 buchdag