Loading tool…
Loading tool…
Loading tool…
Generate a hardened Nginx `server {}` configuration block for Laravel, WordPress, or Static sites with HTTPS, security headers, and PHP-FPM rules.
Your inputs stay in your browser. Make something useful.
Loading tool…
Here’s how to get the most out of nginx config generator.
Because Nginx does not read .htaccess files, all rewrite rules (try_files $uri $uri/ /index.php?$query_string), security headers, and dotfile blocks (location ~ /\.(?!well-known).*) must be declared inside your site’s Nginx server {} block.
A few things you might want to know before you start.
Always run sudo nginx -t on your server before running sudo systemctl reload nginx.
Pointing the document root to Laravel’s public/ directory ensures .env, app/, and storage/ are never directly reachable from the web.
It blocks public access to hidden dotfiles like .env and .git while still allowing Let’s Encrypt SSL validation under /.well-known/.
Use our related Apache .htaccess Generator tool linked below.