Nginx
Web server software, commonly used as a reverse proxy or load balancer.
Cheatsheet
server {
server_name mysite.com;
location {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
}
listen 443;
ssl_certificate /path/to/cert;
ssl_certificate_key /path/to/key;
}
server {
# redirect HTTP to HTTPS
if ($host = mysite.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name mysite.com;
}
Bibliography
- "Avoiding the Top 10 NGINX Configuration Mistakes" (Timo Stark @ F5, 2022)
See also
- Caddy – a modern alternative