Nginx Config Generator

Generate Nginx server blocks visually. Configure reverse proxy, SSL, static files, and redirects with a GUI.

About This Tool

The Nginx Config Generator is a free browser-based tool that helps developers and system administrators create correctly formatted Nginx server block configurations without memorizing the complex directive syntax. Nginx is the most widely used web server and reverse proxy in the world, powering over a third of all websites on the internet.

Writing Nginx configurations by hand is error-prone. A single missing semicolon or misplaced directive can cause the server to fail to start. This visual builder eliminates that problem by generating syntactically correct configurations every time. Choose from preset templates for common use cases like static file serving, reverse proxying to Node.js, Python, or Go backends, PHP-FPM with FastCGI, single page application routing, WordPress, load balancing, and HTTPS redirects.

The tool supports full SSL/TLS configuration including certificate paths, protocol selection (TLSv1.2 and TLSv1.3), HTTP-to-HTTPS redirection, and HSTS headers. You can add multiple location blocks with different match types (prefix, exact, regex, priority prefix) and configure each one as a proxy pass, static file server, FastCGI handler, redirect, or try_files fallback. Security headers like X-Frame-Options, Content-Security-Policy, and Referrer-Policy can be toggled on with a single click.

All processing happens entirely in your browser. No data is sent to any server, and no account is required. The generated configuration can be copied to your clipboard or downloaded as a .conf file ready to drop into your /etc/nginx/sites-available/ directory.

How to Use

  1. Optionally select a preset template to start with a common configuration such as Static File Server, Reverse Proxy, PHP-FPM, SPA, WordPress, Load Balancer, or HTTPS Redirect.
  2. In the Server tab, enter your domain name, choose a listen port, set the root directory, and configure index files and logging paths.
  3. Switch to the SSL/TLS tab to enable HTTPS. Configure certificate and key paths, select TLS protocols, and optionally enable HTTP-to-HTTPS redirect and HSTS.
  4. In the Locations tab, configure one or more location blocks. Choose the path, match type, and handler type (proxy_pass, static, FastCGI, redirect, or try_files).
  5. For reverse proxy locations, enter the upstream URL and toggle proxy headers and WebSocket support as needed.
  6. Open the Advanced tab to enable security headers, gzip compression, and rate limiting with customizable parameters.
  7. Review the generated configuration in the output panel on the right, then Copy to clipboard or Download as a .conf file.

About This Tool

View all 25 Nginx guides →

FAQ

What is an Nginx server block?

A server block (sometimes called a virtual host) is an Nginx configuration section that defines how to handle requests for a specific domain or IP address. Each server block can have its own listen port, root directory, SSL settings, and location rules. Multiple server blocks can coexist in a single Nginx installation to serve different websites.

How do I use the generated configuration?

Download or copy the configuration, then save it to a file in your Nginx configuration directory, typically /etc/nginx/sites-available/. Create a symbolic link to /etc/nginx/sites-enabled/, then run nginx -t to test the configuration and sudo systemctl reload nginx to apply changes.

What is the difference between proxy_pass and try_files?

proxy_pass forwards requests to another server (like a Node.js or Python backend), acting as a reverse proxy. try_files looks for files on the local filesystem in order and falls back to a specified URI if none are found. SPAs typically use try_files $uri $uri/ /index.html to serve the app for all routes.

Should I enable gzip compression?

Yes, in most cases. Gzip compression reduces the size of text responses (HTML, CSS, JavaScript, JSON) by 60-80%, significantly improving page load times. The CPU overhead is negligible on modern servers. The tool configures sensible defaults for MIME types and compression level.

What security headers should I enable?

At a minimum, enable X-Content-Type-Options (prevents MIME sniffing), X-Frame-Options (prevents clickjacking), and Referrer-Policy. For stronger security, add a Content-Security-Policy tailored to your application. If using HTTPS, enable Strict-Transport-Security (HSTS) in the SSL section.

What is rate limiting and when should I use it?

Rate limiting restricts the number of requests a client can make per second. It protects against brute-force attacks, DDoS attempts, and abusive scraping. The tool configures a limit_req_zone with a shared memory zone and allows you to set the rate (e.g., 10 requests per second) and burst size for handling short traffic spikes.

Is my data safe with this tool?

Yes. The entire tool runs client-side in your browser. No data is transmitted to any server. You can verify this by checking your browser's network tab. Your server names, paths, and configuration details never leave your machine.

Related Tools

Robots.txt Generator

Generate robots.txt files with a visual editor for user-agents, allow/disallow rules, and sitemap entries.

Meta Tag Generator

Generate HTML meta tags, Open Graph, and Twitter Card tags with live SNS preview.

Curl to Code Converter

Convert curl commands to Python, JavaScript fetch, PHP, Go, and more programming languages.

Chmod Command Generator

Generate chmod and chown commands visually. Select permissions with a GUI and get the full shell command.

CSP Header Generator

Build Content Security Policy headers visually with directive presets and real-time policy output.

SSH Config Generator

Generate ~/.ssh/config entries visually. Configure hosts, identity files, proxy jumps, and connection options.

Content-Type Header Builder

Build Content-Type headers with the correct MIME type, charset, and boundary parameters. Copy as header or curl flag.

CORS Header Builder

Build CORS headers visually. Configure allowed origins, methods, headers, and credentials with live header output.

Systemd Unit File Generator

Generate systemd service unit files visually. Configure service type, restart policy, environment variables, and download ready-to-use .service files.

Log Format Parser

Parse and color-code server logs from Apache, Nginx, JSON, syslog, Docker, and Kubernetes formats with severity filtering and statistics.

Makefile Generator

Generate Makefiles visually with targets, dependencies, variables, and templates for C, Go, Node.js, Python, and Docker projects.

GitLab CI Config Generator

Build .gitlab-ci.yml pipeline configurations visually. Define stages, jobs, artifacts, caching, and rules for GitLab CI/CD.

Cache-Control Builder

Build Cache-Control headers visually with toggle switches for every directive, duration presets, and server config snippets.