Hello, I’m sorry to hear that you’re experiencing issues with Rank Math on your Nginx reverse proxy setup. To resolve this issue, you will need to add some rewrite rules manually to your Nginx server configuration.
You can add the following rewrite rules to your Nginx server to fix the sitemap issue:
# 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
After adding these rules, you’ll also need to flush your sitemap settings. To do so, head over to Rank Math SEO → Sitemap Settings in your WordPress admin area and make any minor changes to the Links Per Sitemap count. Then click the Save Changes button.
If you encounter any issues while adding these rules, please reach out to your server administrator or hosting support for further assistance.
I hope this helps! If you have any other questions or need further assistance, feel free to ask.
Sources:
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
Rank Math Sitemap Issues and Their Fixes » Rank Math
Rank Math XML Sitemaps on NGINX Servers » Rank Math
Hello,
Thank you for contacting Rank Math support.
Rank Math or any other popular SEO plugin’s sitemap will not work with reverse proxy as all the plugins use the URLs from WordPress.
Please do not hesitate to let us know if you need our assistance with anything else.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.