0
0
Nginxdevops~20 mins

Canary deployments in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Canary Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Canary deployment traffic split with NGINX
Given this NGINX configuration snippet for canary deployment, what percentage of traffic is routed to the canary backend?
Nginx
upstream backend {
    server backend-v1.example.com weight=1;
    server backend-v2.example.com weight=1;
}

server {
    listen 80;
    location / {
        proxy_pass http://backend;
    }
}
A10%
B25%
C50%
D0%
Attempts:
2 left
💡 Hint
Weights in upstream servers determine traffic distribution proportionally.
Configuration
intermediate
2:00remaining
Configure NGINX for 10% canary traffic
Which NGINX upstream configuration correctly routes 10% of traffic to the canary backend and 90% to the stable backend?
A
upstream backend {
    server stable.example.com weight=9;
    server canary.example.com weight=1;
}
B
upstream backend {
    server stable.example.com weight=10;
    server canary.example.com weight=1;
}
C
upstream backend {
    server stable.example.com;
    server canary.example.com weight=0.1;
}
D
upstream backend {
    server stable.example.com weight=1;
    server canary.example.com weight=9;
}
Attempts:
2 left
💡 Hint
Weights are relative and must be integers.
Troubleshoot
advanced
2:00remaining
Why is canary traffic not reaching the canary backend?
You configured NGINX with a canary backend using weights, but all traffic goes to the stable backend. What is the most likely cause?
AThe canary backend server is down or unreachable.
BThe stable backend has a lower weight than the canary backend.
CNGINX does not support weighted upstreams.
DThe proxy_pass directive is missing in the location block.
Attempts:
2 left
💡 Hint
Check backend server health and connectivity.
🔀 Workflow
advanced
3:00remaining
Steps to implement a canary deployment with NGINX
What is the correct order of steps to perform a canary deployment using NGINX?
A2,3,1,4
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Think about deploying first, then routing traffic, then monitoring, then scaling.
Best Practice
expert
2:30remaining
Best practice for canary deployment rollback with NGINX
If the canary deployment shows errors, what is the safest way to rollback using NGINX configuration?
AStop the canary backend server without changing NGINX configuration.
BRemove the canary backend from the upstream block and reload NGINX.
CSet the canary backend weight to zero and reload NGINX.
DIncrease the stable backend weight and reload NGINX.
Attempts:
2 left
💡 Hint
Rollback means no traffic should go to canary backend.