如何使用 IIS 创建 Nginx 负载均衡器?这个问题对我来说并不容易描述。所以我把我的问题分成了两个阶段。
1)IIS网站(app1.xyz.com,app2.xyz.com,app3.xyz.com)前面有1个Nginx服务器(app.xyz.com)所有请求都发送到app.xyz.com,因为它是负载均衡器。这样做容易吗?如何通过使用带有 powershell 的 Octopus 来做到这一点。
2) 我必须通过同时部署 app2.xyz.com 和 app3.xyz.co 来停止 app1.xyz.com。在职的。
什么时候
app1.xyz.com (DOWN) app1.xyz.com (UP) app1.xyz.com (UP)
app1.xyz.com (UP) app1.xyz.com (DOWN) app1.xyz.com (UP)
app1.xyz.com (UP) app1.xyz.com (UP) app1.xyz.com (DOWN)
在不停止所有 Web 应用程序的情况下逐步部署。请看下面的图片我画的:
nginx.conf:
worker_processes 4;
events {
worker_connections 1024;
}
http {
client_max_body_size 100M;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream loadbalancer.xyz.com {
server staging1.xyz.com:996;
server staging2.xyz.com:997;
keepalive 15;
}
server {
listen 999;
location / {
proxy_pass https://loadbalancer.xyz.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
}
}