Complete the code to define an exact match location in nginx.
location [1] /exact {
proxy_pass http://backend;
}The = modifier defines an exact match location in nginx.
Complete the code to define a case-insensitive regular expression location.
location [1] \.jpg$ {
root /images;
}The ~* modifier defines a case-insensitive regex location in nginx.
Fix the error in the location block to make it a prefix match with higher priority.
location [1] /images/ {
root /data;
}The ^~ modifier defines a prefix match with higher priority than regex.
Fill both blanks to create a regex location that matches .png files case-sensitively.
location [1] \.png$ { root [2]; }
The ~ modifier is for case-sensitive regex. The root path is set to /var/www/images.
Fill all three blanks to create a location block that matches exactly /api, proxies to backend, and sets a header.
location [1] /api { proxy_pass [2]; proxy_set_header [3] $host; }
The = modifier is for exact match. proxy_pass points to backend URL. proxy_set_header Host $host; sets the Host header.