Skip to main content
wp-config.org

Server configuration

Nginx config generator for WordPress

Use this Nginx config generator to create a configuration you can edit for WordPress, WooCommerce, static sites or a reverse proxy on Ubuntu. Choose TLS, compression, caching and protection for sensitive files, then download the files with the install commands.

  • Ubuntu 24.04 and 26.04
  • HTTP/3 and Brotli options
  • WooCommerce cache rules

Free, no sign-up. It runs in your browser, so nothing you type is sent to this site.

Nothing you enter leaves your browser.

This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.

Nginx

What you can do

  • WordPress, WooCommerce, static site and reverse proxy presets

  • TLS, HTTP/2 and optional HTTP/3

  • Gzip and optional Brotli compression

  • Protection for sensitive files and cache controls

  • File previews and a downloadable configuration bundle

How to set up Nginx for WordPress

  1. Describe your server

    Choose the Ubuntu release, package source and server profile that match the server you will set up.

  2. Add your sites

    Enter the domains, document roots, PHP socket and certificate paths, then review the security and caching options.

  3. Test before you reload

    Read the installation notes, back up the existing files and run nginx -t on the real server before you reload Nginx.

Plan Nginx routing, security and caching together

This free Nginx config generator targets Ubuntu 24.04 LTS and 26.04 LTS. Set up one or more sites, choose what each one runs and review the server blocks and supporting files it writes. The WordPress and WooCommerce options include permalink routing and cache exclusions for logins, carts and checkouts.

Know the limits

HTTP/3 needs an Nginx build with QUIC support and a network that lets QUIC through. Brotli needs compatible modules; choosing it here does not install them. Certificates, file paths and upstream services must already exist on your server. Check the caching rules against your real login, cart, checkout and account pages before you turn them on. The configuration is generated in your browser, and it cannot prove a speed gain.

After you deploy, check the result with the HTTP/2 test, the HTTP/3 test, the Brotli test and the HSTS checker. Plan PHP-FPM and PHP extensions for the same server, and build redirect rules for moved pages.

Frequently asked questions

Where do Nginx site files go on Ubuntu?

Usually in /etc/nginx/sites-available, linked into /etc/nginx/sites-enabled. Shared snippets often go in /etc/nginx/snippets or /etc/nginx/conf.d.

How do I apply the configuration safely?

Run sudo nginx -t to test it, then sudo systemctl reload nginx. A reload keeps current connections open.

Does WordPress need .htaccess on Nginx?

No. Nginx ignores .htaccess files. Pretty permalinks use a try_files rule that passes unknown paths to index.php.

How do I turn on HTTP/3 in Nginx?

You need Nginx 1.25 or later built with QUIC support, a quic listen line on port 443, UDP port 443 open in every firewall and an Alt-Svc header. Then check it with the HTTP/3 test.

Related tools

  • wp-config.php

    Generate a wp-config.php with database settings, new salt keys and explained options.

  • PHP extensions

    Plan PHP extensions, PHP-FPM and OPcache settings for WordPress.

  • Redis

    Generate Redis settings for a WordPress object cache, with matching wp-config.php options.

  • .htaccess to Nginx

    Convert a WordPress or WooCommerce .htaccess file into Nginx rules, with every line explained.

Host WordPress on StackMattic

StackMattic sponsors these free tools. If you would rather not set up and look after the server yourself, StackMattic runs managed WordPress and server hosting.