Recall & Review
beginner
What is a server block in nginx?
A server block is a configuration section in nginx that defines how to handle requests for a specific domain or IP address. It tells nginx what to do when it receives a request for that server.
Click to reveal answer
beginner
Which directive defines the domain or IP address nginx listens to in a server block?
The
server_name directive specifies the domain names or IP addresses that the server block will respond to.Click to reveal answer
beginner
What is the purpose of the
listen directive in a server block?The
listen directive tells nginx which IP address and port to listen on for incoming requests.Click to reveal answer
beginner
How do you specify the folder where nginx should look for website files in a server block?
You use the
root directive inside the server block or inside a location block to specify the folder path where the website files are stored.Click to reveal answer
intermediate
What is the role of the
location block inside a server block?A
location block defines how nginx should process requests for specific paths or URLs within the server block. It can control routing, proxying, or serving files.Click to reveal answer
Which directive in an nginx server block specifies the domain names it should respond to?
✗ Incorrect
The
server_name directive tells nginx which domain names or IP addresses the server block will handle.What does the
listen 80; directive do inside a server block?✗ Incorrect
The
listen 80; directive tells nginx to listen on port 80, which is the default port for HTTP.Where do you specify the folder path for website files in nginx?
✗ Incorrect
The
root directive sets the folder path where nginx looks for website files.What is the purpose of a
location block inside a server block?✗ Incorrect
A
location block controls how nginx processes requests for certain paths or URLs.Which of the following is NOT part of a typical nginx server block?
✗ Incorrect
git clone is a command for version control, not part of nginx configuration.Describe the main parts of an nginx server block and their roles.
Think about how nginx knows what domain to serve, where to listen, and where to find files.
You got /4 concepts.
Explain how nginx uses the
location block inside a server block to handle requests.Consider how different URLs might need different handling.
You got /4 concepts.