How can I create Nginx load balancer with IIS? This question is not easy to describe for me. So I separated 2 phases about my problem.
1)there is 1 Nginx server(app.xyz.com) infront of IIS Websites (app1.xyz.com,app2.xyz.com,app3.xyz.com ) All requests are sent to app.xyz.com because it is a load balancer. Is it easy to do that? How can I do that by using Octopus with powershell.
2) I have to stop app1.xyz.com by deploying while app2.xyz.com and app3.xyz.co. working.
When
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)
step by step deploying without stopping all web apps. Please look at below pictures What I draw:
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;
}
}
}