Hello,
I apologize for the issue you are facing with your sitemap on the NGINX server. Since you’ve already added the rewrite rules to your configuration file, let’s go through some additional steps to troubleshoot and fix the sitemap issue.
1. Verify Sitemap Generation
First, check if your sitemap is being generated correctly. You can do this by visiting:
`https://premium.wpmudev.org/blog/w3-total-cache-settings/#uaGroups?utm_campaign=RankMath
If this URL loads your sitemap, it means that Rank Math is generating it successfully but may not be able to rewrite it to sitemap_index.xml
.
2. Add Additional Rewrite Rules
If the sitemap is not loading, ensure that you have included all necessary rewrite rules in your NGINX configuration file. Here’s the complete set of rules you should have:
# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last;
# END Nginx Rewrites for Rank Math Sitemaps
3. Flush Sitemap Settings
After adding or modifying the rewrite rules, you need to flush your sitemap settings:
- Go to Rank Math SEO → Sitemap Settings in your WordPress admin area.
- Make a minor change to the Links Per Sitemap count and click Save Changes.

4. Flush Permalinks
Next, navigate to WordPress Dashboard → Settings → Permalinks. You don’t need to make any changes here; just click the Save Changes button to flush the permalinks.

5. Exclude Sitemap from Caching
Ensure that your sitemap is excluded from caching. If you are using a caching plugin, refer to this dedicated knowledgebase article for guidance.
6. Disable Transient Caching (if necessary)
If the above solutions do not resolve the issue, you can disable transient caching by adding the following filter to your theme’s rank-math.php
file:
/**
* Filter if XML sitemap transient cache is enabled.
*
* @param boolean $unsigned Enable cache or not, defaults to true
*/
add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
7. Check for Conflicts
If you are still experiencing issues, check for potential plugin conflicts using the Health Check plugin.
If you continue to face problems after trying these steps, please reply to this ticket with your site URL so that a human agent can assist you further. Thank you for raising this concern!
Sources:
Rank Math XML Sitemaps on NGINX Servers » Rank Math
Rank Math Sitemap Issues and Their Fixes » Rank Math