Complete the code to define an upstream block named 'backend'.
upstream [1] { server 192.168.1.10:80; server 192.168.1.11:80; }
The upstream block name is 'backend' to group backend servers.
Complete the code to use the upstream block 'backend' in a server location.
location /api/ {
proxy_pass http://[1];
}The proxy_pass directive should point to the upstream block named 'backend'.
Fix the error in the upstream block by completing the missing directive.
upstream backend {
server 192.168.1.10:80;
[1] 192.168.1.11:80;
}Each server in the upstream block must be declared with the 'server' directive.
Fill both blanks to configure load balancing with least connections and set max fails.
upstream backend {
[1] 192.168.1.10:80 max_fails=3 fail_timeout=30s;
[2] 192.168.1.11:80 max_fails=3 fail_timeout=30s;
least_conn;
}Both backend servers must be declared with the 'server' directive to apply settings and load balancing.
Fill all three blanks to create an upstream block with weighted servers and health checks.
upstream backend {
[1] 192.168.1.10:80 weight=5 max_fails=2 fail_timeout=20s;
[2] 192.168.1.11:80 weight=3 max_fails=2 fail_timeout=20s;
[3] 192.168.1.12:80 weight=2 max_fails=2 fail_timeout=20s;
}All backend servers must be declared with the 'server' directive to set weights and health check parameters.