Complete the code to match URLs ending with .jpg using a case-sensitive regex.
location ~ [1] { }The ~ operator in nginx is for case-sensitive regex matching. The pattern \.jpg$ matches strings ending with '.jpg'.
Complete the code to match URLs ending with .PNG or .png using a case-insensitive regex.
location ~* [1] { }~ instead of ~* for case-insensitive matching.The ~* operator in nginx is for case-insensitive regex matching. The pattern \.png$ matches strings ending with '.png' or '.PNG' or any case variation.
Fix the error in the code to correctly match URLs starting with /images/ using a case-sensitive regex.
location ~ [1] { }^ causes matching anywhere in the string.The caret ^ anchors the regex to the start of the string. To match URLs starting with '/images/', use ^/images/.
Fill both blanks to match URLs ending with .css or .js using a case-insensitive regex.
location ~* [1] { } # matches files ending with [2]
The regex \.(css|js)$ matches strings ending with '.css' or '.js'. Using ~* makes it case-insensitive.
Fill all three blanks to match URLs starting with /api/ followed by digits, case-sensitive.
location ~ [1][2][3] { }
The regex ^/api/\d+$ matches URLs starting with '/api/' followed by one or more digits until the end of the string.