Nginx Reverse Proxy

#681212
  • Resolved Anonymous
    Rank Math free

    Hello, is there a way to get Rankmath Working with an nginx reverse proxy?

    Our wordpress site and backend is wp.example.com, but the public facing site is example.com.

    Rankmath thinks that the core domain is wp.example.com resulting in a broken sitemap and other issues.

    WE’re specifically hoping to get the sitemap working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Nginx Reverse Proxy’ is closed to new replies.