Nginx Config Generator

Generate an nginx server block with TLS and a proxy pass in your browser.

  • Runs locally in your browser
  • No upload required

Try it

File path only; never certificate contents.

File
nginx-site.conf
Blocks
server
Content
# Generated in the browser — review this file and adapt it to your project before committing. server { listen 80; server_name example.com; root /var/www/example; location / { proxy_pass http://backend:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
# Generated in the browser — review this file and adapt it to your project before committing.
server {
  listen 80;
  server_name example.com;
  root /var/www/example;
  location / {
    proxy_pass http://backend:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Generated an nginx configuration with 2 block(s).

How it works

  • Wrote a server block for example.com proxying http://backend:3000.
  • Added the HTTP→HTTPS redirect.
  • Added the 443 listener and referenced the certificate paths.
  • Certificate values are file paths, never certificate contents.
  • Run `nginx -t -c <file>` yourself to test the config before reloading.

Methodology

  1. Validate the server name, root, upstream and TLS paths.
  2. Emit an optional HTTP redirect server block, then the main server block with listener, proxy and headers.
  3. Reference certificate paths only; never read or emit certificate content.

Usage

  1. Enter the server name, document root and proxy upstream.
  2. Toggle TLS and the HTTP→HTTPS redirect; provide certificate paths when TLS is on.
  3. Copy the generated server block into your nginx config.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

TLS reverse proxy

jsonSelect to copy
{
  "serverName": "example.com",
  "root": "/var/www/example",
  "upstream": "http://backend:3000",
  "tls": true,
  "certPath": "/etc/ssl/certs/example.crt",
  "keyPath": "/etc/ssl/private/example.key",
  "redirectHttp": true
}

Limitations

What the generated block does

The server block listens on 80 or 443, sets `server_name`, optionally serves a root, and proxies `location /` to the upstream with the standard forwarding headers.

Frequently asked questions

Can I paste my certificate into the tool?
No. The tool accepts the certificate and key file paths only; it never handles key material.
Why is the redirect a separate server block?
A plain `listen 80` server that returns 301 is the conventional way to redirect HTTP to HTTPS without mixing it with the TLS listener.

Sources

  1. nginx documentation — F5 / nginx
  2. ngx_http_proxy_module — F5 / nginx