Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port mapping not working? #362

Closed
opichon opened this issue Feb 14, 2016 · 5 comments
Closed

port mapping not working? #362

opichon opened this issue Feb 14, 2016 · 5 comments

Comments

@opichon
Copy link

opichon commented Feb 14, 2016

I have a bunch of docker containers, which obviously must each expose different ports.
I want to use the proxy so that each container is accessible via a different url, but all with port 80. That is the whole point, isn't it.

This used to work, but not anymore.

Now each container works only on its original port.

For example, if I have defined a container with nginx on port 8001, and I map it to my.hostname.org, then I can only open it in a browser with this url: http://my.hostname.org:8001

http://my.hostname.org gives me a nginx "service unavailable error" message.

@wader
Copy link

wader commented Feb 14, 2016

Can you provide more information? how are the containers configured and started? using the new docker networking? how does the generated nginx config look?

@opichon
Copy link
Author

opichon commented Feb 14, 2016

The problem, as far as I can see, comes from using version 2.0 docker-compose files. The same file, written in version 1, works. When written in version 2.0, it doesn't. The only difference is that in version 2, the file starts with:

version: "2"
services:
etc.

Using version 2, the proxy container's /etc/nginx/conf.d/default.conf file shows entries without a host ip address, like this:
upstream www.frimus.org {
# october_nginx_1
server :80;
}

When using version 1, the entry shows an ip address:

upstream www.frimus.org {
# october_nginx_1
server 172.17.0.9:80;
}

@opichon
Copy link
Author

opichon commented Feb 14, 2016

Here are the versions of docker and docker-compose I use:
Docker version 1.10.1, build 9e83765
docker-compose version 1.6.0, build unknown

@wader
Copy link

wader commented Feb 14, 2016

Version 2 will use the new networks feature that nginx-proxy does not support yet. There are some efforts going on to support it #305 #337

@tkw1536
Copy link
Collaborator

tkw1536 commented Apr 10, 2022

Resolved by #337.

@tkw1536 tkw1536 closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants