Skip to content
Foxipa
Code Completion 5 Challenges

Complete the config: Nginx Production Architectures

Fill in edge-tier patterns, container health endpoints, and ingress-shaped routing.

Advanced ~4 min read

Challenge 1

Give load balancers a cheap liveness endpoint.

nginx Your answer
location = /healthz {
    access_log off;
     200;
}

Press Ctrl⌘Enter to check your answer

Challenge 2

Advertise the HTTP/3 endpoint to returning clients.

nginx Your answer
add_header  'h3=":443"; ma=86400';

Press Ctrl⌘Enter to check your answer

Challenge 3

Route the API prefix to the service gateway.

nginx Your answer
location  {
    proxy_pass http://gateway;
}

Press Ctrl⌘Enter to check your answer

Challenge 4

Inject the container's environment into the config template.

nginx Your answer
envsubst '$' < nginx.conf.tmpl > /etc/nginx/nginx.conf

Press Ctrl⌘Enter to check your answer

Challenge 5

Run NGINX in the foreground as PID 1 (container contract).

nginx Your answer
 off;

Press Ctrl⌘Enter to check your answer