permalinks and reverse proxy
-
Hello,
I am trying to setup WordPress behind a reverse proxy.
My wordpress installation resides at http://blog.raileurope.com/development/
I have setup a reverse proxy on the server http://publicx.raileurope.com:8082 so that requests for http://publicx.raileurope.com:8082/blog/ are forwarded to http://blog.raileurope.com/development/After my sysadmin enabled mod_proxy, everything worked fine, except all the URL generated in the blog pages were pointing to http://blog.raileurope.com/development/ (because wordpress uses absolute URL).
So I went ahead and added the following code to my wp-config.php
if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) { define ('WP_HOME' , $_SERVER['HTTP_X_FORWARDED_HOST'] ) ; define ('WP_SITEURL' , $_SERVER['HTTP_X_FORWARDED_HOST'] ) ; $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'] ; }This solved my initial problem, ensuring that the links were built correctly, showing the domain of my reverse proxy server (http://publicx.raileurope.com:8082/blog), rather than the domain of the wordpress server (http://blog.raileurope.com/development).
But a new problem occurred: all my blog pages accessed from the reverse proxy are giving me a 404 when permalinks are enabled.
If I disable permalinks, the blog works fine from the reverse proxy.So, I’m stuck – and I am at loss as to how to debug this.
Any help would be appreciated. Thank you.Lothaire
The topic ‘permalinks and reverse proxy’ is closed to new replies.