3

I am using a local proxy using apache2 to do some development work (OSX 10.8):

SSLProxyEngine on

ProxyPass /app https://my.server.org/app
ProxyPass /web https://my.server.org/web

Everything works fine, except Apache2 some how overrides the content-type response header for html files. If I request https://my.server.org/app/index.html the content type is text/html, whereas for http://localhost/app/index.html I get to see the correct page, but the content type is set to text/plain making the browser display unrendered html code. It only seems to happen for html files. Why is this happening?

Jeroen Ooms
  • 2,239
  • 8
  • 34
  • 51

1 Answers1

2

So the problem appeared to be that the back-end server was not setting any Content-Type headers for some files due to misconfiguration. When this happens, mod_proxy inserts a Content-Type based on local configuration like DefaultType in Apache.

I have not been able to figure out what caused the different behavior between OSX and Ubuntu, but after we fixed the back-end server to always send a Content-Type response header, the problem disappeared.

Jeroen Ooms
  • 2,239
  • 8
  • 34
  • 51