Nginx reverse proxy config generator
Put your app behind nginx with HTTPS. Enter the domain and the local port and get a server block with Let’s Encrypt certificates, redirects, WebSocket support, gzip and optional rate limiting, plus the commands to get the certificate.
The order of steps
- Point the domain to the server, then install nginx. Its default site answers on port 80, which is all certbot needs to prove the domain is yours.
- Get the certificate with certbot certonly, then add this file, remove the default site and reload.
- The port 80 block keeps serving /.well-known/acme-challenge/, so certbot renews the certificate on its own.
What the extras do
- WebSocket support passes the Upgrade header, which Socket.IO, live dashboards and many admin panels need.
- Rate limiting answers 429 to an address that sends too many requests, which slows down scrapers and password guessing.
- Security headers stop other sites from framing yours and stop browsers from guessing file types.
Nginx versions
The file uses listen 443 ssl http2, which every nginx since 1.9.5 understands. Nginx 1.25 and newer prints a deprecation warning for it and keeps working; there you can switch to a separate http2 on; line.
More tools
- VPS ping test
- VPS cost calculator
- chmod calculator
- Cron generator
- Subnet calculator
- SSH key generator
- Bandwidth calculator
- What is my IP
- Cloud-init generator
- SSH hardening generator
- UFW firewall generator
- Fail2ban config generator
- WireGuard config generator
- Docker Compose generator
- Systemd service generator
- Swap size calculator
- DNS lookup