Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 am using the proxy_balancer in Apache2 to proxy requests to a Rails application to my rails server on the port the application is running on. This is how its set up...

Rails Server Mongrel running on port 8000, when accessing the url directly to http://rails_server:8000 the site loads fine

Apache Server Conf file for the site:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    <Proxy balancer://application_cluster>
            Allow from localhost
            BalancerMember retry=10

    ProxyPass / balancer://application_cluster

The problem I am having is going to http://rails_server:8000 works fine, but going to Loads the right content, but is displaying all the HTML as text and not rendering it as html

share|improve this question
I miss a ProxyPassReverse / balancer://application_cluster directive. Also, what's the output of curl -I ? – Iñigo Sep 12 '11 at 11:21

Try adding

ProxyPassReverse / balancer://application_cluster

like Inigo said in his comment. Just below ProxyPass.

(wow just realized I'm over a year late with this post, "unanswered question" it is but I doubt the author ever comes back)

share|improve this answer

I would check the content type returned by the URLs in question. It sounds like one is passing "text/html" and the other "text/plain" . . . perhaps in your proxy configuration you need to frob some content-type setting.


share|improve this answer
It is giving me a content type of text/plain, but when I use this same method to proxy to Mongrel instances running on the same machine as Apache things work fine, why would this be happening just because it is coming from a different server? – trobrock Jun 22 '10 at 15:05
If I set the DefaultType directive in the conf file it shows the html file, but every other file such as css files get the text/html content type. Why is this proxy not detecting the proper content type for the files? – trobrock Jun 22 '10 at 15:18
Honestly, I have no experience with this. Just taking a stab that Apache is messing with the content-type. Hopefully someone has a proper solution. Good luck! – dannyman Jun 22 '10 at 20:14

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.