Interview Prep/Networking/Load Balancers, Proxies & CDNs

Show a minimal nginx reverse proxy configuration.

IntermediateConceptLoad Balancers, Proxies & CDNs
Answer
upstream app {
    server 10.0.1.10:8080 max_fails=3 fail_timeout=10s;
    server 10.0.1.11:8080;
    keepalive 32;
}
server {
    listen 443 ssl http2;
    server_name app.example.com;
    ssl_certificate     /etc/ssl/app.crt;
    ssl_certificate_key /etc/ssl/app.key;
    location / {
        proxy_pass http://app;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Test with nginx -t and reload with nginx -s reload.

All Networking questions Roadmap: Networking for DevOps

More on Load Balancers, Proxies & CDNs