ErrorDocument and ProxyErrorOverride
am 15.01.2010 11:48:29 von Mark Watts--=-4XxD/GkMzrwO3iWQ4Xlp
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
I have a two Apache 2.2.13 servers. One is a straight proxy (doing SSL
offload) through to the other.
The proxy has the following settings relating to my issue:
ErrorDocument 404 /errors/error404.html
ProxyErrorOverride on
=20
ProxyPass / http://192.168.1.1/
ProxyPassReverse / http://192.168.1.1/
This means 404's caused by content not existing on the back-end server
are captured by the proxy, which in turn pulls the page from the
back-end server. (The real configuration is more complicated, since in
reality I'm proxying another location to some IIS boxes, and they don't
have the customised error page).
I'm under the impression from the ErrorDocument documentation
(http://httpd.apache.org/docs/2.2/mod/core.html#errordocumen t) that my
custom 404 page should be being returned, while retaining the 404 status
code since I'm not technically redirecting it to another server from the
client PoV.
Indeed, testing this locally (without a proxy) returns me a customised
page and a 404 status code.
Does this still hold when your ErrorDocument is actually behind a proxy?
Testing here suggests not - I'm getting the custom page but with a 200.
Naturally, this means that logs from the proxy never include 404's,
which isn't the case. (I can't really use logs from the back-end server,
since they don't reflect the true source IP).
Mark.
--=20
Mark Watts BSc RHCE MBCS
Senior Systems Engineer, Managed Services Manpower
www.QinetiQ.com
QinetiQ - Delivering customer-focused solutions
GPG Key: http://www.linux-corner.info/mwatts.gpg
--=-4XxD/GkMzrwO3iWQ4Xlp
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEABECAAYFAktQR/wACgkQBn4EFUVUIO2zawCg5Cs6GUXTpPweSPZpmo/z cY2G
JLUAoL7ZN61XbOqS3cmkSBR6HBQamj1o
=9an+
-----END PGP SIGNATURE-----
--=-4XxD/GkMzrwO3iWQ4Xlp--