Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Build a secure, optimized nginx server block with HTTPS, HTTP/2, HSTS, gzip, reverse proxy, and PHP support. Copy or download the config, no sign-up required.
Test with nginx -t, then reload nginx. Issue the referenced certificates with Certbot.
An Nginx config generator is a free online tool that turns a set of options into a valid Nginx server block. Instead of recalling every directive, you toggle features like HTTPS, HTTP/2, gzip, and reverse proxy, and the tool writes the configuration file for you, ready to copy or download.
Under the hood it composes the listen and server_name directives, the SSL block, security headers, compression, asset caching, and a location block matched to your application type, whether that is a static site, a single-page app, PHP-FPM, or a reverse proxy. The result mirrors the hand-written configs you would otherwise maintain by editing files on the server.
Nginx sits in front of your application as a web server and reverse proxy, so its configuration decides how traffic is routed, secured, and cached. A small mistake in a directive can break TLS, leak the server version, or slow every response. Getting the server block right matters because:
Building a server block takes only a few seconds, and you do not need to install anything to use the generator itself. Follow these steps:
As a tool, the Nginx config generator offers a set of capabilities that make writing a production server block effortless. Here are the features of our generator:
A generated server block is useful anywhere you stand up, secure, or proxy a site with Nginx. The generator speeds up each of these workflows by writing the directives for you:
All processing happens in your browser and no data is uploaded, so your domain, document root, and upstream details never leave your machine. This generator is maintained by TestMu AI (formerly LambdaTest), the team behind a unified testing platform that runs across 10,000+ real devices and 3000+ browsers, so it is shaped by the same focus on reliable, secure web infrastructure that QA and DevOps teams depend on.
Nginx and Apache are the two most common web servers, but they are configured very differently. The table below sums up how their configuration models compare:
| Aspect | Nginx | Apache |
|---|---|---|
| Config unit | server and location blocks in a single .conf file | VirtualHost blocks plus per-directory .htaccess files |
| Reload model | Loaded once at start or reload; no per-request rules | .htaccess can be read on every request at runtime |
| Rewrites | try_files and rewrite directives inside location blocks | mod_rewrite RewriteRule directives in .htaccess |
| Static performance | Event-driven; efficient at high concurrency for static files | Process or thread per connection; heavier under load |
| Typical role | Reverse proxy, load balancer, static and edge server | Application server with embedded modules like mod_php |
An Nginx config generator builds a ready-to-use Nginx server block from a form. You select options like HTTPS, HTTP/2, reverse proxy, and PHP, and it outputs a valid configuration file with the correct directives instead of you writing them by hand.
Yes. The Nginx config generator is completely free with no signup, login, or usage limit. You can build and download as many server blocks as you need. The tool is maintained by TestMu AI (formerly LambdaTest) and runs entirely in your browser.
No. The configuration is assembled entirely in your browser using plain string templating. Nothing is uploaded to a server, and the tool needs no account, API key, or backend, so your domain and proxy details stay on your own machine.
Intermediate is the safe default for most sites and supports TLS 1.2 and 1.3 with strong ciphers. Modern enables only TLS 1.3 for clients that all support it. Old adds legacy TLS versions for very old clients and is the least secure.
Yes. Select the reverse proxy application type and set the upstream host and port. The tool generates a proxy_pass block with the standard proxy headers and WebSocket upgrade headers, ready for apps like Node.js, Django, or any local service.
Enable the HTTPS and HTTP/2 options and pick an SSL profile. The generator writes a listen 443 ssl block, an http2 on directive, the ssl_certificate paths, ssl_protocols, ciphers, and an optional HSTS header so the server block is secure by default.
Save it as /etc/nginx/sites-available/yourdomain.conf, symlink it into sites-enabled, run nginx -t to test the syntax, then reload Nginx. Use Certbot to issue the TLS certificates referenced in the ssl_certificate paths before reloading.
This tool outputs the http2 on; directive used by Nginx 1.25.1 and newer. On older Nginx releases, enable HTTP/2 by adding http2 to the listen line instead, for example listen 443 ssl http2, which the legacy syntax accepts.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance