Skip to content


HTML pages returned as plaintext, who is the culprit?


I have been moving applications from my Rackspace host over to Amazon’s EC2 service.  Moving simple LAMP apps has been fairly cut and dry, but while moving a RoR app and accessing it through apache w/ mod_proxy, the html is delivered to the browser as plaintext.  If I access the app directly on mongrel’s port, it renders correctly.   So it appears that something with either my mod_proxy configuration, or something about how my EC2 instance is set up is causing the problem.


> curl -I http://linux.local:3000
HTTP/1.1 200 OK
Connection: close
Date: Thu, 15 Jul 2010 14:27:27 GMT
Content-Length: 0

> curl -I http://linux.local
HTTP/1.1 200 OK
Date: Thu, 15 Jul 2010 14:27:35 GMT
Via: 1.1 linux.local
Content-Type: text/plain

As you can see, when accessing the page through Apache/mod_proxy, the Content-Type that is returned is explicitly set as text/plain.

Update
This is a bit shoe-horned, but it works for right now. In the apache2.conf file, I changed the DefaultType from text/plain to text/html. The reason this solution “concerns” me is that on my other servers, (where this problem is not occurring) the DefaultType is also set to text/plain, but the html is output correctly.

Posted in Infrastructure. Tagged with .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.

Powered by WP Hashcash