Load-balanced environments not supported
-
In SSL-terminating load-balanced environments, bwp-google-xml-sitemaps fails with the following error:
BWP Google XML Sitemaps Error: sitemapindex.xml does not have any item. Please make sure that you have at least one sitemap enabled in BWP Sitemaps >> XML Sitemaps >> Sitemaps to generate.
This is because of a discrepancy in URL scheme:
– Initial sitemap request comes in on HTTPS.
– Load-balancer terminates SSL and forwards request to content server over HTTP.
– WP_HOME is set to HTTPS.
– BWP detects difference in scheme and fails – BWP_Sitemaps_Sitemap_Provider::is_url_valid() returns false.I suggest removing the lines following “// url must use the current scheme” in bwp-google-xml-sitemaps/src/sitemap/provider/provider.php to remove this restriction.
Alternate solutions:
– Make the check optional depending on configuration.
– Add a hook to allow overriding.
– Add a check to see if $_SERVER[‘HTTP_X_FORWARDED_PROTO’] is “https” when determining $is_ssl.
- The topic ‘Load-balanced environments not supported’ is closed to new replies.