Skip to content
Foxipa
Code Completion 5 Challenges

Complete the config: Nginx Request Control

Fill in rewrite flags, auth_request, mirroring, and signed links.

Advanced ~4 min read

Challenge 1

Apply the rewrite and re-run location matching.

nginx Your answer
rewrite ^/api/(.*)$ /v1/$1 ;

Press Ctrl⌘Enter to check your answer

Challenge 2

Gate this location behind an authorization subrequest.

nginx Your answer
location /private/ {
     /_auth;
    proxy_pass http://backend;
}

Press Ctrl⌘Enter to check your answer

Challenge 3

Shadow production traffic to the test backend.

nginx Your answer
location /api/ {
     /_shadow;
    proxy_pass http://backend;
}

Press Ctrl⌘Enter to check your answer

Challenge 4

Define what the signed-URL MAC covers.

nginx Your answer
location /dl/ {
    secure_link ;
    secure_link_md5 "$secure_link_expires$uri$remote_addr secret";
}

Challenge 5

Reject blocked clients from the map's verdict.

nginx Your answer
if ($blocked) {
     403;
}

Press Ctrl⌘Enter to check your answer