Nginx Config Generator

Generate an nginx server block for PHP, static sites, SPAs or reverse proxies — HTTPS, redirects, gzip and caching.

Runs instantly in your browser — results update as you type.

How do I write an nginx config for my site?

Enter your domain and site type and tick the features you need. The generator writes complete server blocks: HTTP-to-HTTPS and www redirects, Let’s Encrypt certificate paths, security headers, gzip, static file caching and the right location rules for PHP-FPM, SPAs or proxying to a Node/Python app.

How to use the Nginx Config Generator

    Frequently asked questions

    Which PHP socket path should I use?

    Check /run/php/ — it is usually php8.x-fpm.sock matching your PHP version.

    Does it support WebSockets in proxy mode?

    Yes, Upgrade and Connection headers are included.

    Is it safe to use as-is?

    It follows common best practice, but always run nginx -t before reloading.