1

We run a Webshop example.com and a WordPress server at wordpress.example.com

The WordPress Server is connected to the main domain via a reverse proxy.

    ProxyPass /blog https://wordpress.example.com
    ProxyPassReverse /blog https://wordpress.example.com

This works quite okay. But some modules i.e. AMP cannot detect the sub path.

See also this question on the wordpress forum:

https://wordpress.org/support/topic/relamphtml-url-with-proxy/#post-12228181

What is the proper way to run wordpress behind such a proxy? Is there a better way to configure the proxy or the plugin?

  • Is there a reason WP doesn't know that it's at /blog? Or that /blog isn't in the site URL? Then just go to yoursite.com/blog for WP, and yoursite.com/blog/wp-admin etc No weird rewriting necessary, everything gets the right URL first time around – Tom J Nowell Dec 11 '19 at 16:51
0

The following setup could work:

  • on wordpress.example.com make Apache listen to example.com as well
  • put the blog into the same subdirectory
  • proxy pass ProxyPass /blog https://wordpress.example.com
  • ProxyPreserveHost On

so the REQUEST_URI viewed from the wordpress host would be actually the real URL which was requested from the front proxy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.