Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Configure Clean Permalinks for WordPress on Nginx

Set up clean WordPress URLs on Nginx by combining a saved permalink structure, the correct try_files fallback, working PHP-FPM routing, and a systematic 404 checklist.
Length14 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a normal, single-site WordPress installation in Nginx’s document root, clean permalinks work when three pieces agree: WordPress has a saved permalink structure, Nginx sends non-file requests to /index.php, and PHP-FPM executes that script. Put try_files $uri $uri/ /index.php?$args; in the active server block’s location /, configure a separate PHP location that checks the script exists, validate and reload Nginx, then save Settings > Permalinks in WordPress.

What clean permalinks require on Nginx

A permalink is the permanent URL WordPress uses for posts, pages, categories and other archives. You choose the structure in Settings > Permalinks; WordPress stores that choice, but Nginx must route each friendly URL to WordPress’s front controller. WordPress documents the permalink settings and built-in or custom structures here: Customize permalinks.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apache can read directory-level .htaccess rules. Nginx does not: “With Nginx there is no directory-level configuration file like Apache’s .htaccess or IIS’s web.config files,” according to WordPress Developer Resources. The administrator therefore edits the Nginx server {} block. WordPress cannot write this rewrite rule for you.

The standard single-site rule is:

location / {
    try_files $uri $uri/ /index.php?$args;
}

Nginx tests the operands from left to right. An existing file is served as a file, an existing directory is served as a directory, and anything else is internally passed to /index.php. The ?$args suffix preserves the request’s query string, which matters for non-default permalink structures and other requests that carry parameters. This is the pattern shown in the official Nginx guidance at developer.wordpress.org and in the WordPress training lesson on URL rewriting at learn.wordpress.org.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Configure a document-root installation

1. Confirm the document root and index file

Find the Nginx server {} block that answers the site’s hostname. Its root must be the directory containing WordPress’s index.php, and the server should declare PHP as an index file:

server {
    server_name example.com www.example.com;
    root /var/www/example;
    index index.php;

    # location blocks go here
}

Use the real path and hostnames from your installation. If another server block, an earlier default site, or a reverse proxy receives the request, changing an unused block will not change the site you test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before editing, write down the public hostname, the filesystem directory containing index.php, the PHP-FPM socket or TCP endpoint, and any proxy or cache in front of Nginx. This small inventory prevents a common mistake: correcting a syntactically valid block that is not active for the URL being tested.

2. Add the WordPress fallback in location /

location / {
    try_files $uri $uri/ /index.php?$args;
}

Keep this rule in the server block that owns the WordPress root. Do not change the final operand to =404: that would make Nginx reject virtual post, page and archive URLs before WordPress can resolve them. Conversely, the first two operands are important because they allow real CSS, JavaScript, images, uploaded files and directories to be returned directly instead of needlessly invoking PHP.

The rule is not a redirect. Nginx internally selects the front controller, so the browser can retain the clean URL while WordPress receives the request. A real file such as an image stops at the first operand; a directory can stop at the second; only a path with neither a matching file nor directory reaches index.php.

3. Configure PHP separately

The fallback only routes a request; PHP-FPM (or another configured PHP upstream) must execute the resulting script. A typical PHP location includes your distribution’s FastCGI parameter file, passes the request to the PHP upstream already configured on the server, sets the script filename, and rejects nonexistent scripts:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
location ~ .php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass php_backend;
}

php_backend represents the PHP-FPM socket or TCP upstream used by your system; use the name and endpoint already defined in your Nginx configuration. The exact include filename and socket path vary by operating system and PHP package. The security-relevant distinction is that try_files $uri =404; belongs in the PHP location to prevent execution of a script that is not present. It must not replace the fallback in the general location /.

If a PHP URL downloads as text, returns a direct Nginx error, or produces a gateway-style failure, the permalink rule is not the only suspect. Check the FastCGI include, the SCRIPT_FILENAME value, the PHP-FPM socket or TCP upstream, and permissions on the actual script. A working front-controller fallback cannot compensate for an unavailable PHP handler.

4. Validate before reloading

Run the normal syntax check supplied by your platform (commonly nginx -t) and reload only after it reports a valid configuration. A reload applies the new server-block rules without dropping existing connections. If the check identifies duplicate locations, an unknown upstream, or an invalid include, fix that error first rather than testing a partially changed configuration.

Validation should cover the complete active configuration, not just a fragment copied into a note. Confirm that the file you edited is included, that the intended hostname maps to it, and that the PHP upstream name is defined. When a reverse proxy sits in front, test the public hostname as well as the origin where possible so you know which layer produced a response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

5. Save the permalink structure in WordPress

  1. Sign in to the WordPress administration area.
  2. Open Settings > Permalinks.
  3. Select the built-in structure you want, or enter a custom structure such as a post-name pattern.
  4. Click Save Changes, even if the desired option was already selected.

Saving causes WordPress to use the selected URL model for generated links and rewrites. It does not edit Nginx; the server rule remains your responsibility. Re-saving is also a useful diagnostic step after a migration or server change because it confirms that the intended permalink structure is active in the database and dashboard.

How a request is resolved

Understanding the request path makes the configuration easier to diagnose:

  1. A browser requests a URL such as /news/my-post/.
  2. Nginx evaluates $uri. If no file exists at that path, it checks $uri/ for a directory.
  3. When neither exists, Nginx internally routes the request to /index.php.
  4. $args carries the original query string to the front controller.
  5. PHP-FPM executes index.php; WordPress examines the path and returns the matching post, page, archive or a WordPress-generated 404.

This is why a home page can work while every internal URL fails: the home page may be a direct index request, whereas virtual URLs require the final try_files fallback. It also explains why replacing the fallback with a filesystem-only 404 rule appears to “fix” missing-file errors while breaking every URL that exists only in WordPress’s database.

Choosing and checking a permalink structure

WordPress offers built-in structures and a custom-field option. A post-name pattern is a common example, but the Nginx rule does not change when you switch between supported structures. Nginx only needs to send paths that are not physical files or directories to the front controller; WordPress interprets the selected structure after PHP starts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When checking a new structure, open a newly published post and an existing post, then test a page and an archive. If links generated in the dashboard point to one path while requests arrive at another host, directory or scheme, first resolve the site’s active server block and installation path. Do not add extra Nginx rewrites merely because the dashboard displays a custom pattern; the core fallback remains the same for a document-root single site.

WordPress installed in a subdirectory

If the files live under a directory such as /my_subdir rather than directly in the document root, the fallback must name that installation’s front controller:

location / {
    try_files $uri $uri/ /my_subdir/index.php?$args;
}

Use the exact directory and URL model configured for the site. The official guidance for a WordPress installation that has its own directory is Giving WordPress Its Own Directory. A mismatch between the public URL, the filesystem root and the fallback path commonly produces a homepage that works but broken internal links.

Do not blindly copy the document-root example into a subdirectory deployment. Confirm whether the server’s root is the parent directory or the installation directory, then make the fallback and PHP script filename resolve to the actual index.php. Test both a URL under the public site path and a static asset so you can distinguish an incorrect fallback from an incorrect root.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the configuration with a focused test set

After reloading Nginx and saving permalinks, test each request type separately:

  • Home page: confirms the intended server block, root and index handling.
  • One post URL: verifies the virtual-path fallback.
  • One page URL: checks another WordPress rewrite path.
  • An archive: test a category, tag or date archive if the site uses it.
  • A known static asset: request an image, stylesheet or script to ensure real files are served directly.
  • A query-string URL: append a harmless parameter and confirm it reaches the application, demonstrating that $args was preserved.

Use the browser’s network panel or a command-line HTTP client to inspect status codes and redirects. A WordPress 404 generated after PHP runs is different from an Nginx 404 that occurs before the request reaches WordPress. Compare response headers and logs when a cache or reverse proxy is present, because a stale cached 404 can conceal a corrected origin configuration.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Diagnose 404s and other failures

Every post and page returns 404

  • Verify that the request reaches the intended server {} block for the hostname and port.
  • Check that location / ends with /index.php?$args, not =404.
  • Confirm the root contains the WordPress index.php named by the fallback.
  • Save Settings > Permalinks again.

If the response is still an Nginx-generated 404, inspect the active configuration and error log before changing WordPress settings. WordPress’s common-errors guidance also recommends resetting permalinks and investigating configuration-related causes: Common WordPress errors.

The home page works but internal URLs fail

This symptom usually means the front controller is not being selected for virtual paths. Recheck the fallback, the active server block and the permalink save operation. In a subdirectory installation, verify that the fallback includes the installation directory, such as /my_subdir/index.php?$args.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A PHP file downloads or produces a direct Nginx error

Inspect the PHP location, FastCGI parameter include, PHP-FPM socket or TCP upstream, and filesystem permissions. Confirm that SCRIPT_FILENAME resolves to the real file under the configured root. Keep try_files $uri =404; in the PHP location, but leave the WordPress fallback in location /.

Only a migrated or recently changed site fails

Compare the active configuration with the previous root path, server name, PHP upstream and include files. Review migration changes, plugin or theme changes, and permissions. Reset permalinks, then test a post, page and static asset independently. The WordPress common-errors documentation covers configuration and migration-related investigation at developer.wordpress.org.

Static files fail after adding a regex location

A broad regular-expression location can intercept requests that should have been handled by the normal file test or can accidentally affect PHP routing. Ensure that any static-file location does not capture PHP scripts or virtual WordPress URLs incorrectly. Nginx’s explanation of file testing and fallback handling is available in Serving static content.

Implementation choices that change the details

Deployment characteristic What stays the same What must be checked
Document-root install The usual fallback is /index.php?$args. root must contain that file, and index index.php should be set.
Subdirectory install Existing files and directories still use the first two try_files operands. The fallback must include the installation path, for example /my_subdir/index.php?$args.
Single site The standard location / pattern handles virtual URLs. Use the site’s actual host, root and PHP upstream.
Multisite Nginx still needs explicit server-level routing; it does not read .htaccess. Subdirectory or subdomain multisite layouts require path-specific rules; do not assume the single-site snippet is sufficient.
PHP-FPM Unix socket PHP requests still need FastCGI parameters and an existence check. Use the socket path and upstream name supplied by the installed PHP package.
PHP-FPM TCP upstream The WordPress fallback is unchanged. Point fastcgi_pass to the configured host and port and verify connectivity.
Reverse proxy or cache in front The origin Nginx server still needs the correct fallback. Check which layer returns the 404, preserves query strings and applies redirects or cached responses.

The core single-site fallback remains stable across these deployments, while the root path, installation path, multisite layout, PHP transport and proxy behavior determine the surrounding configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For multisite, identify whether sites are represented by subdirectories or subdomains before copying any example. The request may need path-specific handling, and the server must still be configured explicitly because there is no directory-level .htaccess file for WordPress to generate. Treat multisite as a separate layout review rather than assuming that a working single-site block proves the network is configured.

When managed hosting is responsible for the change

On managed WordPress hosting, the provider may administer the Nginx server block and PHP-FPM layer for you. Ask specifically whether the service supports custom permalink routing, subdirectory installs, multisite, and access to configuration or error logs. If you control the server, the procedure above is the change to request or implement; WordPress’s dashboard alone cannot create Nginx rewrite rules.

When opening a support request, include the hostname, whether the install is in the document root or a subdirectory, the exact failing URL, the response status, and whether the home page and static files work. Ask the provider to confirm the active server block, the final try_files operand, the PHP-FPM endpoint and any proxy or cache layer. This gives the administrator enough context to distinguish routing from PHP execution.

Security and maintenance checks

  • Keep the PHP location’s existence check so arbitrary nonexistent script paths are not passed to PHP.
  • Do not expose configuration files or other non-public files through a broad static location.
  • After changing the root, PHP version, server block, plugins or migration settings, repeat the post, page, archive and asset tests.
  • When a cache or reverse proxy is present, purge or bypass cached 404 responses while validating the origin configuration.

Keep a known-good copy of the previous active configuration while making changes. Validate first, reload second, and test from the public hostname third. If the new block causes unexpected responses, reverting the server-block change and then checking the logs is safer than layering additional rewrites over an uncertain configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

The shortest correct configuration model

For a document-root, single-site installation, the essential pieces are one accurate root, index index.php, the following general location, and a separately working PHP-FPM location:

root /var/www/example;
index index.php;

location / {
    try_files $uri $uri/ /index.php?$args;
}

location ~ .php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass php_backend;
}

Adapt the root, upstream name, include file and permissions to the server’s operating system. Validate the complete active configuration, reload Nginx, save the permalink settings, and test representative URLs. If those steps are correct, Nginx serves real files directly and hands every other clean URL to WordPress for resolution.

Frequently asked questions

Why do pretty permalinks return 404 only on Nginx?
Nginx does not read Apache-style .htaccess files, so WordPress cannot create the routing rule automatically. Add the explicit location / fallback in the active server block and ensure PHP-FPM can execute the resulting index.php.

What should the usual single-site try_files line be?
Use try_files $uri $uri/ /index.php?$args;. The first operands serve existing files and directories; the final operand sends virtual paths to WordPress while preserving query arguments.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use try_files $uri =404; in location /?
No. That form is appropriate in the PHP location as an existence check. In the general location it prevents virtual post, page and archive URLs from reaching WordPress.

Why does the home page work while posts fail?
The home page can be served as an index request, while a post URL requires the fallback to index.php. Check the active server block, the final try_files operand, the root path and the saved permalink settings.

What changes for a subdirectory installation?
Point the fallback to the installation’s front controller, for example /my_subdir/index.php?$args, and verify whether the Nginx root is the parent directory or the installation directory. The public URL and filesystem path must agree.

Do I need a different rule for a custom post-name structure?
Usually not for a document-root single site. Select the structure in Settings > Permalinks, save it, and keep the same front-controller fallback. WordPress interprets the path after PHP receives it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How can I tell whether Nginx or WordPress generated the 404?
Inspect the response and logs. An Nginx 404 means the request failed before WordPress ran; a WordPress 404 indicates that PHP reached WordPress but no matching content was resolved. Check proxy or cache responses separately when those layers are present.

Does PHP-FPM use a socket or TCP connection for this rule?
Either can work. The WordPress fallback is unchanged; set fastcgi_pass to the socket or TCP upstream configured by the installed PHP package, include the appropriate FastCGI parameters and verify connectivity.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Will the same snippet cover WordPress multisite?
Do not assume so. Multisite may use subdirectories or subdomains and requires path-specific server rules. Confirm the network layout and test representative site URLs before treating the configuration as complete.

Who should make this change on managed hosting?
The provider may control the Nginx server block and PHP-FPM layer. Ask whether custom permalinks, subdirectory installs and multisite are supported, and request confirmation of the active fallback and relevant logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Why do pretty permalinks return 404 only on Nginx?

Nginx does not read Apache-style .htaccess files. Add the explicit location / fallback in the active server block and ensure PHP-FPM can execute index.php.

What should the usual single-site try_files line be?

Use try_files $uri $uri/ /index.php?$args;. It serves existing files and directories directly and sends virtual paths to WordPress with query arguments preserved.

Can I use try_files $uri =404; in location /?

No. Keep that existence check in the PHP location. In location / it blocks virtual post, page and archive URLs before WordPress can resolve them.

What changes for a subdirectory installation?

Use the installation path in the fallback, such as /my_subdir/index.php?$args, and verify that the public URL, Nginx root and actual index.php agree.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Will the same snippet cover WordPress multisite?

Not necessarily. Subdirectory and subdomain multisite layouts require path-specific rules, so confirm the network layout instead of assuming the single-site example is sufficient.

Who should make this change on managed hosting?

The provider may control Nginx and PHP-FPM. Ask whether custom permalinks, subdirectory installs and multisite are supported and request confirmation of the active fallback and logs.

The Bottom Line

Clean WordPress permalinks on Nginx require an explicit front-controller route: try_files $uri $uri/ /index.php?$args; for a document-root single site, plus a separately working PHP-FPM location with an existence check. Match the root and installation path, preserve query strings, validate and reload Nginx, save the permalink settings, and test posts, pages, archives and static assets. Subdirectory, multisite, proxy and managed-hosting deployments need additional path or responsibility checks.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.