Recall & Review
beginner
What is an
upstream block in nginx?An
upstream block defines a group of backend servers that nginx can proxy requests to. It helps distribute traffic among multiple servers.Click to reveal answer
beginner
How do you define multiple servers inside an
upstream block?Inside the
upstream block, list each server with the server directive, for example:<br>upstream backend {
server 192.168.1.10;
server 192.168.1.11;
}Click to reveal answer
beginner
What is the purpose of the
proxy_pass directive in relation to upstream blocks?The
proxy_pass directive tells nginx to forward client requests to the servers defined in an upstream block, enabling load balancing.Click to reveal answer
intermediate
Name two load balancing methods supported in nginx
upstream blocks.Two common methods are:<br>1.
round-robin (default): requests are distributed evenly.<br>2. least_conn: requests go to the server with the fewest active connections.Click to reveal answer
intermediate
How can you mark a server as a backup in an
upstream block?Add the
backup parameter to the server directive. This server will only receive traffic if all primary servers are down.<br>server 192.168.1.12 backup;
Click to reveal answer
What does an
upstream block in nginx do?✗ Incorrect
An
upstream block groups backend servers to distribute client requests.Which directive inside an
upstream block lists backend servers?✗ Incorrect
The
server directive defines each backend server inside the upstream block.What is the default load balancing method in nginx
upstream blocks?✗ Incorrect
The default method is
round-robin, which distributes requests evenly.How do you tell nginx to use an
upstream block in a server configuration?✗ Incorrect
The
proxy_pass directive forwards requests to the named upstream group.What does the
backup parameter do in an upstream server directive?✗ Incorrect
The
backup server is used only when all primary servers are unavailable.Explain how nginx uses an
upstream block to balance load between servers.Think about how nginx forwards requests to several servers.
You got /4 concepts.
Describe how to configure a backup server in an nginx
upstream block and why it is useful.Consider what happens if main servers go down.
You got /4 concepts.