Nginx Server Block Generator
Production-ready Nginx server blocks for WordPress/PHP-FPM, static sites and reverse proxies – HTTPS, HTTP/2, www redirect and security headers included.
Generate a clean, production-ready Nginx server block for a WordPress site, a PHP app, a static site or a reverse proxy in front of Node, Python or Docker. HTTPS with Let’s Encrypt paths, HTTP/2, a canonical www redirect, security headers, gzip, caching for static files and rules that block hidden files, backups and logs are built in.
Why these defaults
- Backups,
.sqldumps anddebug.logfiles left in the web root are one of the most common data leaks – the deny rules stop them being downloaded. xmlrpc.phpis blocked for WordPress: it is rarely needed and widely abused for brute-force attacks.- PHP is never executed from the uploads folder, so an uploaded file can’t become a backdoor.
Always test first
Run sudo nginx -t before every reload. A syntax error in one site’s file stops Nginx from reloading – and on a shared server that affects every site.
Frequently asked questions
Where do I put the file?
Save it as /etc/nginx/sites-available/<domain>.conf, link it into sites-enabled, then run sudo nginx -t and sudo systemctl reload nginx.
More tools
All tools →Netplan YAML Generator
Generate a correct Netplan file for a static IP or DHCP on Ubuntu 18.04 to 26.04 – with the right gateway syntax, file permissions and apply commands.
Open tool Linuxsystemd Service Generator
Turn any script or app into a systemd service that starts on boot, restarts on failure and runs as a locked-down user.
Open tool LinuxCrontab Generator
Build a cron schedule from plain choices, read any cron expression in plain English and preview the next run times.
Open tool