Nginx Config Generator
Generate an Nginx server block for a static site, PHP/Laravel app, or reverse proxy, with optional SSL and HTTPS redirect.
Choose your scenario - static site, PHP/Laravel, or reverse proxy - and enter your domain; this tool generates a starting Nginx server block.
Always test with nginx -t before reloading, and confirm SSL certificate paths match your actual setup.
For a dedicated redirect-only or reverse-proxy-only configuration, see the Nginx Redirect Generator and Nginx Reverse Proxy Generator.
What Is an Nginx Server Block?
An Nginx server block (similar to an Apache virtual host) defines how Nginx handles requests for a specific domain - which directory serves the files, how PHP requests are handled, whether to redirect to HTTPS, and where logs are written.
Why Use This Tool?
A correct server block needs several pieces to work together (root path, index files, PHP-FPM socket path, SSL certificate paths) and a small mistake in any one can break the whole site. This tool generates a working starting configuration for common scenarios.
How to Use It
- Choose a scenario: static website, PHP/Laravel, or reverse proxy.
- Enter your domain name and relevant paths (document root, or backend host/port for a proxy).
- Optionally enable SSL and an HTTP-to-HTTPS redirect.
- Copy the generated configuration into your Nginx sites-available directory.
Limitations
This is a solid starting configuration, not a guarantee of production-readiness - always test with nginx -t before reloading Nginx, and review SSL certificate paths match your actual setup.