enduro
May 14, 2013, 11:48pm
1
Hi
I’m setting a custom 404 page with:
server {
…
error_page 404 /errors/not-found.html;
}
And the page looks as follows:
<link
href=“/favicon.ico” rel=“shortcut icon” type=“image/vnd.microsoft.icon”
/>
Seite nicht gefunden
Die angeforderte Seite existiert
nicht.
Page non trouvée
Cette page n’éxiste
pas.
Page Not Found
This page does not exist.
This is what I get with “curl -i http://wemakeit.ch/cache/doesnotexist ”:
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?
Thanks!
enduro
May 15, 2013, 12:09am
2
On Tue, May 14, 2013 at 5:47 PM, Svoop [email protected] wrote:
Hi
I’m setting a custom 404 page with:
server {
…
error_page 404 /errors/not-found.html;
}
…
Any idea what I’m doing wrong here?
Thanks!
Looks like your 404s are being generated by a backend, not by nginx. You
may want to use fastcgi_intercept_errors / proxy_intercept_errors.
Richard S. <r1ch+nginx@…> writes:
Looks like your 404s are being generated by a backend, not by nginx. You
may want to use fastcgi_intercept_errors / proxy_intercept_errors.
You’re right, but since the pages are served via Passenger, these
directives
won’t work. However, I found a way to pass the correct content type in
the
routing table.
Thanks!
2013/5/15 Svoop [email protected] :
However, I found a way to pass the correct content type in the routing table.
… which you may want to share, so that later people can look for a
working solution?
Regards, Andre