0
0
Nginxdevops~10 mins

Weighted round-robin in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set up a basic upstream block for load balancing.

Nginx
upstream backend {
    server 192.168.1.1[1];
}
Drag options to blanks, or click blank then click option'
A:80 weight=5
B;
Cweight=5
D:80
Attempts:
3 left
💡 Hint
Common Mistakes
Adding weight without a space or without the port number
Using only weight without specifying port or semicolon
2fill in blank
medium

Complete the code to assign a weight of 3 to the server in the upstream block.

Nginx
upstream backend {
    server 192.168.1.2:80 [1];
}
Drag options to blanks, or click blank then click option'
Aweight=3
Bweight:3
Cweight 3
Dweight=5
Attempts:
3 left
💡 Hint
Common Mistakes
Using space instead of equals sign
Using colon instead of equals sign
Wrong weight number
3fill in blank
hard

Fix the error in the upstream block to correctly assign weights to two servers.

Nginx
upstream backend {
    server 192.168.1.3:80 weight=2;
    server 192.168.1.4:80 [1];
}
Drag options to blanks, or click blank then click option'
Aweight 3
Bweight= 3
Cweight=3
Dweight:3
Attempts:
3 left
💡 Hint
Common Mistakes
Missing semicolon at end of server line
Using space or colon instead of equals sign
4fill in blank
hard

Fill both blanks to create an upstream block with two servers having weights 4 and 6.

Nginx
upstream backend {
    server 192.168.1.5:80 [1];
    server 192.168.1.6:80 [2];
}
Drag options to blanks, or click blank then click option'
Aweight=4
Bweight=6
C;
Dweight=5
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong weight numbers
Missing semicolons
Using incorrect syntax for weight
5fill in blank
hard

Fill all three blanks to configure an upstream with weighted round-robin load balancing.

Nginx
upstream backend {
    [1] 192.168.1.7:80 [2];
    [3] 192.168.1.8:80 weight=7;
}
Drag options to blanks, or click blank then click option'
Aserver
Bweight=5
Dweight=3
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the 'server' keyword
Incorrect weight syntax
Missing semicolons