Recall & Review
beginner
What is a directive in nginx configuration?
A directive is a single instruction in nginx configuration that sets a specific parameter or behavior, like setting a port or enabling a feature.
Click to reveal answer
beginner
What is a block in nginx configuration?
A block groups multiple directives together inside curly braces { } to apply settings to a specific context, like a server or location.
Click to reveal answer
intermediate
How do directives and blocks relate in nginx config?
Directives can be simple single lines or can contain blocks. Blocks hold other directives inside them to organize settings hierarchically.
Click to reveal answer
beginner
Example of a simple directive in nginx?
Example:
listen 80;This tells nginx to listen on port 80.
Click to reveal answer
beginner
Example of a block directive in nginx?
Example:
server {
listen 80;
server_name example.com;
} This block configures a server with specific settings.Click to reveal answer
What symbol starts a block in nginx configuration?
✗ Incorrect
Blocks in nginx configuration start with a curly brace { and end with }.
Which of these is a directive in nginx?
✗ Incorrect
A directive is a single instruction like 'listen 80;'. Blocks group directives.
What does a block in nginx configuration do?
✗ Incorrect
Blocks group multiple directives to apply settings in a specific context like server or location.
Which is the correct way to write a directive?
✗ Incorrect
Directives end with a semicolon ; in nginx configuration.
Where would you find blocks in nginx config?
✗ Incorrect
Blocks are used inside contexts like server or location to group related directives.
Explain what directives and blocks are in nginx configuration and how they work together.
Think about single instructions versus grouped instructions.
You got /4 concepts.
Describe how you would configure nginx to listen on port 80 using directives and blocks.
Remember the structure of a server block.
You got /3 concepts.