Middle+
How was Nginx configured? Was there an interesting config?
sobes.tech AI
Answer from AI
I configured Nginx as a reverse proxy and load balancer for multiple web services. One interesting configuration involved setting up SSL termination with automatic certificate renewal via Let's Encrypt, as well as using directives for caching static content and rate limiting to protect against DDoS.
A simplified example configuration:
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
location / {
proxy_pass http://backend_servers;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
add_header Cache-Control "public";
}
limit_req zone=one burst=5;
}
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;