Recall & Review
beginner
What is the order of location matching priority in nginx?
nginx matches locations in this order: 1) Exact match (=), 2) Longest prefix match, 3) Regular expression (~ or ~*), 4) If no match, default location (/).
Click to reveal answer
beginner
What does the '=' symbol mean in an nginx location block?
The '=' symbol means an exact match. nginx will serve this location only if the request URI exactly matches the location path.
Click to reveal answer
intermediate
How does nginx handle multiple prefix locations that match a request URI?
nginx chooses the longest matching prefix location among those without '=' or regex modifiers.
Click to reveal answer
intermediate
What is the difference between '~' and '~*' in nginx location blocks?
'~' means case-sensitive regular expression match, while '~*' means case-insensitive regular expression match.
Click to reveal answer
beginner
What happens if no location matches a request URI in nginx?
nginx uses the default location '/' if no other location matches the request URI.
Click to reveal answer
Which location block does nginx check first when matching a request URI?
✗ Incorrect
nginx first checks for an exact match location block marked with '='.
If multiple prefix locations match, which one does nginx choose?
✗ Incorrect
nginx selects the longest matching prefix location.
What does the '~*' modifier mean in an nginx location?
✗ Incorrect
'~*' means case-insensitive regular expression match.
When does nginx use the default location '/'?
✗ Incorrect
nginx uses the default location '/' if no other location matches the request URI.
Which location type has the lowest priority in nginx matching?
✗ Incorrect
The default location '/' is used only if no other location matches.
Explain the priority order nginx uses to match a request URI to a location block.
Think about how nginx tries to find the most specific match first.
You got /4 concepts.
Describe the difference between prefix match and regular expression match in nginx location blocks.
Consider how nginx interprets the location block modifiers.
You got /4 concepts.