0
0
Nginxdevops~10 mins

Keepalive connections 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 enable keepalive connections in the upstream block.

Nginx
upstream backend {
    server backend1.example.com;
    [1] 32;
}
Drag options to blanks, or click blank then click option'
Alisten
Bkeepalive
Cproxy_pass
Dserver
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'proxy_pass' inside the upstream block instead of 'keepalive'.
Confusing 'listen' directive with keepalive settings.
2fill in blank
medium

Complete the code to enable keepalive connections in the proxy settings.

Nginx
location / {
    proxy_pass http://backend;
    proxy_http_version 1.1;
    [1] 100;
}
Drag options to blanks, or click blank then click option'
Aproxy_keepalive
Bkeepalive_timeout
Cproxy_set_header
Dkeepalive_requests
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'proxy_keepalive' which is not a valid directive.
Confusing 'keepalive_timeout' with enabling keepalive requests.
3fill in blank
hard

Fix the error in the keepalive timeout configuration.

Nginx
keepalive_timeout [1] 20s;
Drag options to blanks, or click blank then click option'
Aoff
Bon
Ckeepalive
Dproxy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'on' which is invalid for keepalive_timeout.
Using 'keepalive' or 'proxy' which are not valid values here.
4fill in blank
hard

Fill both blanks to configure upstream keepalive connections and proxy settings correctly.

Nginx
upstream backend {
    server backend1.example.com;
    [1] 64;
}

location / {
    proxy_pass http://backend;
    proxy_http_version 1.1;
    [2] 100;
}
Drag options to blanks, or click blank then click option'
Akeepalive
Bkeepalive_requests
Cproxy_set_header
Dkeepalive_timeout
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing 'keepalive_timeout' with 'keepalive_requests'.
Using 'proxy_set_header' instead of keepalive directives.
5fill in blank
hard

Fill all three blanks to configure keepalive connections with timeout and request limits.

Nginx
upstream backend {
    server backend1.example.com;
    [1] 32;
}

location / {
    proxy_pass http://backend;
    proxy_http_version 1.1;
    [2] 100;
    [3] 75s;
}
Drag options to blanks, or click blank then click option'
Akeepalive
Bkeepalive_requests
Ckeepalive_timeout
Dproxy_set_header
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'proxy_set_header' instead of keepalive directives.
Confusing 'keepalive_timeout' with 'keepalive_requests'.