Complete the code to define the server block for the blue environment.
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://[1];
}
}The blue environment backend is named blue_backend in the proxy_pass directive.
Complete the code to define the upstream block for the green environment.
upstream [1] { server 10.0.0.2:8080; server 10.0.0.3:8080; }
The upstream block for the green environment is named green_backend.
Fix the error in the load balancer configuration to route traffic to the active environment.
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://[1];
}
}The load balancer should route traffic to the active_backend, which points to the currently active environment.
Fill both blanks to configure health checks for blue and green upstreams.
upstream blue_backend {
server 10.0.0.1:8080 [1];
}
upstream green_backend {
server 10.0.0.2:8080 [2];
}The blue backend uses max_fails=3 and the green backend uses fail_timeout=10s for health checks.
Fill all three blanks to complete the blue-green deployment routing with sticky sessions.
upstream active_backend {
ip_hash;
server 10.0.0.1:8080 [1];
server 10.0.0.2:8080 [2];
}
server {
listen 80;
location / {
proxy_pass http://[3];
}
}The upstream servers have health checks with max_fails=3 and fail_timeout=15s. The proxy_pass uses active_backend to route traffic.