Nginx 404 WordPress Permalink Checklist
WordPress 404 errors on Nginx often come from missing try_files rules, wrong root path, broken permalink settings or a server block pointing to the wrong directory. This checklist helps isolate the cause.
Common causes
- Nginx server block missing WordPress try_files rule.
- Wrong root path.
- Permalink settings not saved.
- Wrong domain server block is being used.
- Cache still shows old URLs.
- WordPress page or post slug changed.
Checklist
- Check if only pretty permalinks are broken.
- Open a direct query URL if needed.
- Check WordPress permalink settings.
- Resave permalinks.
- Check Nginx root path.
- Check server_name.
- Verify try_files rule for WordPress.
- Run nginx -t.
- Reload Nginx.
- Clear cache and test again.
Final check
The issue is fixed when posts, pages, categories and custom URLs load correctly without breaking the homepage.
When to Use This Checklist
Use this checklist when WordPress pages or posts return 404 on an Nginx VPS while the homepage may still work.
Required Tools
WordPress admin, SSH access, Nginx server block, cache plugin, domain access
Before You Start
Before editing Nginx config, save a copy of the current server block so you can roll back quickly.
Structured Checklist Steps
- Check if homepage works.
- Check if posts return 404.
- Resave permalinks.
- Check Nginx root path.
- Check server_name.
- Verify try_files rule.
- Run nginx -t.
- Reload Nginx.
- Clear cache.
- Test pages and posts.
Verification Steps
- Homepage loads.
- Posts load.
- Pages load.
- nginx -t passes.
- No wrong domain loads.
Rollback Plan
If the new Nginx rule breaks the site, restore the previous server block and reload Nginx after passing nginx -t.
Common Mistakes
- Using Apache .htaccess logic on Nginx.
- Wrong root path.
- Forgetting to resave permalinks.
- Reloading Nginx without testing config.
- Editing the wrong server block.
Related Commands
sudo nginx -t
sudo systemctl reload nginx
curl -I https://example.com/sample-post/
sudo nano /etc/nginx/sites-available/example.com
try_files $uri $uri/ /index.php?$args;