error_page without content type

Svoop svoop at
Tue May 14 21:47:27 UTC 2013


I'm setting a custom 404 page with:

server {
  error_page 404 /errors/not-found.html;

And the page looks as follows:

<!DOCTYPE html><html lang="de"><head><meta charset="utf-8" /><link
href="/favicon.ico" rel="shortcut icon" type="image/"
/><link href="/assets/application-5432c43a667ce7273e0604560a540d71.css"
media="all" rel="stylesheet" type="text/css" /></head><body><div
id="main"><div id="page"><img alt="Wmkt-logo"
src="/assets/wmkt-logo-fdb0e2494a44ea8b38242b1bf1ae5f9a.png" /><br /><br
/><h2>Seite nicht gefunden</h2><p>Die angeforderte Seite existiert
nicht.</p><hr /><h2>Page non trouvée</h2><p>Cette page n'éxiste pas.</p><hr
/><h2>Page Not Found</h2><p>This page does not exist.</p><hr

This is what I get with "curl -i":

HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Connection: keep-alive
Keep-Alive: timeout=20
Status: 404 Not Found
X-Request-Id: 6fc3d91efbddf9a5f9dbf32f6d4aff32
X-Runtime: 0.002343
Date: Tue, 14 May 2013 21:46:48 GMT
X-Rack-Cache: miss
X-Content-Type-Options: nosniff
X-Powered-By: Phusion Passenger 4.0.2
Server: nginx/1.2.6 + Phusion Passenger 4.0.2

There's not Content-Type header, which is why Chrome shows the page source
instead of rendering the HTML.

Any idea what I'm doing wrong here?


More information about the nginx mailing list