Hello
I have container with below file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
stream {
upstream cb_80 {
server server-04.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-05.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-06.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-07.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-08.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-09.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-10.domain.com:35373 max_fails=2 fail_timeout=30s;
}
server {
listen 80;
proxy_pass cb_80;
}
}
stream {
upstream cb_443 {
server server-04.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-05.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-06.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-07.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-08.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-09.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-10.domain.com:33688 max_fails=2 fail_timeout=30s;
}
server {
listen 443;
proxy_pass cb_443;
}
}
the host which runs this conatiner will get he :80 & :443 with above
so mysite.domain.com:80 & mysite.domain.com:443 shuould do the lb
problem is
docker run --detach --name mysite --restart=unless-stopped --publish 80:80 --volume ${PWD}/nginx.conf:/etc/nginx/nginx.conf:ro nginx:stable-alpine
i can expose only 1 port
pls suggest
I have container with below file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
stream {
upstream cb_80 {
server server-04.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-05.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-06.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-07.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-08.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-09.domain.com:35373 max_fails=2 fail_timeout=30s;
server server-10.domain.com:35373 max_fails=2 fail_timeout=30s;
}
server {
listen 80;
proxy_pass cb_80;
}
}
stream {
upstream cb_443 {
server server-04.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-05.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-06.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-07.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-08.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-09.domain.com:33688 max_fails=2 fail_timeout=30s;
server server-10.domain.com:33688 max_fails=2 fail_timeout=30s;
}
server {
listen 443;
proxy_pass cb_443;
}
}
the host which runs this conatiner will get he :80 & :443 with above
so mysite.domain.com:80 & mysite.domain.com:443 shuould do the lb
problem is
docker run --detach --name mysite --restart=unless-stopped --publish 80:80 --volume ${PWD}/nginx.conf:/etc/nginx/nginx.conf:ro nginx:stable-alpine
i can expose only 1 port
pls suggest