Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Apache Proxy setup in front of an HTTP daemon process that serves a Sinatra web application with the following Directives (which work great)

ProxyPass / http://ip-ad-dr-ess:8080/
ProxyPassReverse / http://ip-ad-dr-ess:8080/

This allows me to browse and served the content from the daemon web server. I would like to include a wordpress blog as a subdirectory to the main site. <- Sinatra <- Wordpress

Here is the entire config section

<IfModule mod_proxy_http.c>
LogLevel debug
ProxyRequests Off
ProxyPass /blog
ProxyPassReverse /blog
ProxyPass / http://ip-ad-dr-ess:8080/
ProxyPassReverse / http://ip-ad-dr-ess:8080/
<Location />
    RequestHeader set X-Forwarded-Protocol http
<Location /blog>
    RequestHeader set X-Forwarded-Protocol http
ProxyPreserveHost on
ProxyErrorOverride Off

The problem I am having is when I navigate to I am served content from not from the Wordpress.

As a test, in the config above I replaced with and when I navigate to I am simply redirected to Google's site (with the URL in the address bar) which is not the behavior I expected.

Any idea of how I can resolve or maybe further debug this issue as to why the wordpress content is not be served?


Update excerpt

<VirtualHost ip-ad-dr-ess:80>
DocumentRoot /home/path/
DirectoryIndex index.html index.shtml index.htm Index.html Index.htm Index.shtml$
ErrorLog /home/path/logs/
Alias /stats /home/path/logs/
<Directory /home/path/logs/>
AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,Includes,Indexes$
Alias /doc/analog /usr/share/analog
RewriteEngine on
RewriteCond %{HTTP_HOST}       [NC]
RewriteRule ^(.*)$1  [R=301,NE]
share|improve this question
Might be a dumb questsion, but does work as expected? Also you should ommit the trailing slashes from the ""; or add one to the "/blog" before it – Christopher Perrin Jun 21 '12 at 12:47
@cperrin88 the blog site does serve content as expected. I tried removing the trailing slashes, and the port number with the same result. – Karl Jun 21 '12 at 13:12
First of all needs to work correctly. If you put it in the browser on the server the blog should pop up. Otherwise the ReverseProxy can't do a thing. Is the blog servered on the same host? – Christopher Perrin Jun 21 '12 at 13:14
@cperrin88 Yes the blog does work, and it is served on the same host – Karl Jun 21 '12 at 13:18

You should try adding a trailing slash the path "/blog" like this

ProxyPass /blog/
ProxyPassReverse /blog/
share|improve this answer returns a 404 (from the application) and serves the content from the main site – Karl Jun 21 '12 at 13:39
The first error is normal because the resourcees /blog and /blog/ are different. You need to write a rewrite rule to send the /blog requests to /blog. The Second error is more puzzling as you say that works fine. I can't see the problem here. I guess the problem lies somewhere in the config of – Christopher Perrin Jun 21 '12 at 13:48
Would you mind posting the config of – Christopher Perrin Jun 21 '12 at 13:54
Yes, the issue is that and are rending the same content. Maybe seeing the live site will clear things up. and – Karl Jun 21 '12 at 13:54
Is there anything specific you want to see from – Karl Jun 21 '12 at 13:55

I was able to solve this issue. The root cause was that the I setup a proxy from one virtualhost to another on the same ip and the same port.

I changed the to listen on a different port, updated the proxy values in which resolved the problem

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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