Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set an exact match for the location block in nginx.
Nginx
location [1] /about.html { } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '~' which is for regex match.
Using '^~' which is for prefix match.
Using '~*' which is for case-insensitive regex.
✗ Incorrect
The '=' modifier in nginx location blocks is used for exact match of the URI.
2fill in blank
mediumComplete the code to configure nginx to serve a file only on exact URI match.
Nginx
location [1] /contact { root /var/www/html; } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifiers which allow partial or pattern matches.
Using prefix match '^~' which matches URI prefixes.
✗ Incorrect
Using '=' ensures nginx serves content only when the URI matches exactly '/contact'.
3fill in blank
hardFix the error in the nginx location block to make it an exact match.
Nginx
location [1] /home { proxy_pass http://backend; } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifiers which do not guarantee exact match.
Omitting the modifier which defaults to prefix match.
✗ Incorrect
The '=' modifier is required for exact URI matching in nginx location blocks.
4fill in blank
hardFill both blanks to create an exact match location block that serves a static file.
Nginx
location [1] [2] { root /usr/share/nginx/html; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifier '~' instead of '='.
Using a URI that is not exact or intended.
✗ Incorrect
The '=' modifier sets exact match and '/index.html' is the exact URI to match.
5fill in blank
hardFill all three blanks to configure nginx with an exact match location that proxies requests.
Nginx
location [1] [2] { proxy_pass [3]; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifier '~' instead of '='.
Using incorrect URI path.
Incorrect proxy_pass URL.
✗ Incorrect
Use '=' for exact match, specify the exact URI '/api/v1', and set proxy_pass to backend URL.