I was able to configure the reverse proxy of my heroku application with the following in config.ru
require ::File.expand_path('../config/environment', __FILE__) use Rack::ReverseProxy do reverse_proxy /^\/blog(.*)$/, 'http://blog.domain.com$1', opts={:preserve_host => true} end run Appname::Application
This allows my heroku application to run on com.com and have domain.com/blog as the URL while the wordpress site is hosted by blog.domain.com. Great bye.
The wordpress site is correctly served when switching to the .com / blog domain, however, when I go to any deeper page, for example, a separate Wordpress message gives an error. I used permalinks with the date and name in the form URL: domian.com/blog/2012/07/a-great-blog-post - Worpress now doesn't seem to like it. When I switched the links back to the domain.com/blog/?p=4 form, the page was successfully served.
It does not seem to process or sort slashes after the correct domain.com/blog domain name. What I find strange is that domain.com/blog/wp-admin (and the whole WP admin application) works without any hiccups.
Can anyone see any glaring problems why pages / posts with a few slashes "/" can cause problems?
Thanks in advance!
source share