我正在使用Jenkins和Docker实现docker解决方案。
在运行时,将决定在单独的docker容器中启动多少个wildfly实例。所有这些实例都使用Nginx进行负载平衡。
目前我的nginx.conf支持3个容器。我想在app-service列表下添加n个机器。有没有办法在nginx中提供这个?这是我的nginx.conf
worker_processes 4;
events { worker_connections 1024; }
http {
upstream app-service {
least_conn;
server appA:8080;
server appB:8080;
server appC:8080
}
server {
listen 80;
listen 443 default ssl;
server_name appserver.domain.com;
# Add Certificate
#added my certs herey
# optimization SSL code
# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
location / {
proxy_pass http://app-service;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}
I can modify app-server list after starting all the instances but I am looking for a clean solution.
目前我只创建了一台服务器'在nginx.conf文件和QA或Production中,我将能够分离端口80和443