Complete the code to enable keepalive connections in the upstream block.
upstream backend {
server backend1.example.com;
[1] 32;
}The keepalive directive inside the upstream block sets the number of idle keepalive connections to upstream servers.
Complete the code to enable keepalive connections in the proxy settings.
location / {
proxy_pass http://backend;
proxy_http_version 1.1;
[1] 100;
}The keepalive_requests directive enables keepalive connections by specifying how many requests can be sent over a single keepalive connection.
Fix the error in the keepalive timeout configuration.
keepalive_timeout [1] 20s;
The keepalive_timeout directive accepts a time value or 'off' to disable it. Using 'off' disables keepalive timeout.
Fill both blanks to configure upstream keepalive connections and proxy settings correctly.
upstream backend {
server backend1.example.com;
[1] 64;
}
location / {
proxy_pass http://backend;
proxy_http_version 1.1;
[2] 100;
}The keepalive directive in the upstream block sets the number of idle keepalive connections. The keepalive_requests directive sets how many requests can be sent over one keepalive connection.
Fill all three blanks to configure keepalive connections with timeout and request limits.
upstream backend {
server backend1.example.com;
[1] 32;
}
location / {
proxy_pass http://backend;
proxy_http_version 1.1;
[2] 100;
[3] 75s;
}The keepalive directive sets idle connections in upstream. keepalive_requests limits requests per keepalive connection. keepalive_timeout sets the timeout for keepalive connections.