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.
More on Load Balancers, Proxies & CDNs
What is a load balancer and why do we use one?BeginnerWhat is the difference between L4 and L7 load balancing?IntermediateCompare ALB, NLB, GWLB and Classic Load Balancer in AWS.IntermediateWhat load-balancing algorithms are common?BeginnerWhat are health checks and how should they be designed?AdvancedWhat is connection draining (deregistration delay)?Intermediate