0
0
Nginxdevops~10 mins

Round-robin (default) 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 define an upstream block using the default round-robin method.

Nginx
upstream backend {
    server [1];
}
Drag options to blanks, or click blank then click option'
A192.168.1.10:80
Bround_robin
Cweight=5
Dip_hash
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to specify 'round_robin' explicitly inside the upstream block.
2fill in blank
medium

Complete the code to proxy requests to the upstream group named 'backend'.

Nginx
location / {
    proxy_pass http://[1];
}
Drag options to blanks, or click blank then click option'
Alocalhost
B192.168.1.10
Cbackend
Dupstream
Attempts:
3 left
💡 Hint
Common Mistakes
Using an IP address instead of the upstream group name.
3fill in blank
hard

Fix the error in the upstream block by completing the missing server address.

Nginx
upstream backend {
    server [1];
    server 192.168.1.11:80;
}
Drag options to blanks, or click blank then click option'
Aweight=3
B192.168.1.10:80
Cip_hash
Dbackup
Attempts:
3 left
💡 Hint
Common Mistakes
Putting parameters like 'weight=3' instead of an IP address.
4fill in blank
hard

Fill both blanks to create an upstream block with two servers using default round-robin.

Nginx
upstream backend {
    server [1];
    server [2];
}
Drag options to blanks, or click blank then click option'
A192.168.1.20:80
Bweight=5
C192.168.1.21:80
Dip_hash
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters instead of server addresses in server directives.
5fill in blank
hard

Fill all three blanks to create a proxy_pass directive inside location that uses the 'backend' upstream group.

Nginx
location /app/ {
    proxy_pass http://[1]/[2];
    proxy_set_header Host [3];
}
Drag options to blanks, or click blank then click option'
Abackend
Bapp
C$host
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' instead of the upstream group name.
Not forwarding the original host header.