2
I have a docker image that I can access via domain.com:8080/
from any computer. But I cant get it redirect to domain.com/service/
UPDATED: found my answer, see below.
2
I have a docker image that I can access via domain.com:8080/
from any computer. But I cant get it redirect to domain.com/service/
UPDATED: found my answer, see below.
0
So just to summarize, I have found the answer.
I can't use jwilder/nginx as that is only for hostnames - so I have to use nginx on the host server to rewrite a rule. I am still using docker-compose with my editted hosts file so that I have easier access locally between containers, but my rewrite rule binds on the port I have exposed.
0
This redirection should be configured for web server listening to port 80 of domain.com.
Under assumption you've mentioned details of your container, you should publish port 80 from your container
docker run ... -p 8080 -p 80 ...
and configure this redirections in the configuration of nginx.
Thanks checking if it works. As a follow up what about the reverse proxy nginx docker image, is that a possibility? – mjh – 2016-12-07T12:44:46.770
So you want to redirect
domain.com:8080
todomain.com/service/
? You can do that in the Nginx on docker right? Just make sure the server atdomain.com:8080
sends an HTTP 301 back to the client. – mtak – 2016-12-07T10:07:53.807just so I am sure I am getting it, this is what it would look like, yes?
Where does 8000 come from? In your question it says 8080. – mtak – 2016-12-07T13:45:59.000
was a bit too quick for my comment sry. Yes 8080. – mjh – 2016-12-07T13:59:58.127