How to run WordPress behind a reverse proxy so that extensions still can detect the path

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.