I have a Nginx Docker container and 16 load-balanced servers, each of which hosts a port on the host machine 8081-8096:
docker run -d \
--restart always \
--name "web.${name}" \
-v /srv/web/web-bundle:/bundle \
-p "${port}":80 \
kadirahq/meteord:base
The My Nginx container previously linked to a single image webbefore I tried to scale:
docker run -d \
--name nginx \
--link web.1:web.1 \
-v /srv/nginx:/etc/nginx \
-v /srv/nginx/html:/usr/share/nginx/html \
-p 80:80 \
-p 443:443 \
nginx
Nginx upstream config:
upstream web {
ip_hash;
server 127.0.0.1:8081;
server 127.0.0.1:8082;
server 127.0.0.1:8083;
}
I need this Nginx image to be able to hit 127.0.0.1:8081-8096, however it doesn't seem to allow this. I do not want to do 16 --links! It seems to be off.
What is the right way to do this?
source
share