0
0
Nginxdevops~10 mins

Exact match (=) in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
A=
B~
C~*
D^~
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.
2fill in blank
medium

Complete 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'
A^~
B~
C~*
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifiers which allow partial or pattern matches.
Using prefix match '^~' which matches URI prefixes.
3fill in blank
hard

Fix 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'
A~
B=
C^~
D~*
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifiers which do not guarantee exact match.
Omitting the modifier which defaults to prefix match.
4fill in blank
hard

Fill 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'
A=
B/index.html
C/home
D~
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifier '~' instead of '='.
Using a URI that is not exact or intended.
5fill in blank
hard

Fill 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'
A=
B/api/v1
Chttp://backend_server
D~
Attempts:
3 left
💡 Hint
Common Mistakes
Using regex modifier '~' instead of '='.
Using incorrect URI path.
Incorrect proxy_pass URL.