0
0
Nginxdevops~10 mins

Connection pooling to upstream 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 named 'backend'.

Nginx
upstream [1] {
    server backend1.example.com;
}
Drag options to blanks, or click blank then click option'
Aupstream_pool
Bproxy
Cbackend
Dserver_pool
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like 'proxy' or 'server_pool' that don't match usage.
2fill in blank
medium

Complete the code to enable keepalive connections with 32 connections.

Nginx
upstream backend {
    server backend1.example.com;
    [1] 32;
}
Drag options to blanks, or click blank then click option'
Akeepalive
Bmax_fails
Cfail_timeout
Dmax_conns
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'max_fails' or 'fail_timeout' with connection pooling.
3fill in blank
hard

Fix the error in the proxy_pass directive to use the upstream named 'backend'.

Nginx
location / {
    proxy_pass http://[1];
}
Drag options to blanks, or click blank then click option'
Abackend1.example.com
Bserver_pool
Cupstream
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using direct server hostname disables connection pooling.
4fill in blank
hard

Fill both blanks to configure proxy settings for connection reuse and timeout.

Nginx
location / {
    proxy_http_version [1];
    proxy_set_header Connection [2];
    proxy_pass http://backend;
}
Drag options to blanks, or click blank then click option'
A1.1
Bclose
Ckeep-alive
D1.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using HTTP/1.0 or 'close' disables connection pooling.
5fill in blank
hard

Fill all three blanks to create an upstream with two servers and enable keepalive connections.

Nginx
upstream backend {
    server [1];
    server [2];
    [3] 16;
}
Drag options to blanks, or click blank then click option'
Abackend1.example.com
Bbackend2.example.com
Ckeepalive
Dmax_fails
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'max_fails' instead of 'keepalive' for connection pooling.