The custom error page policy is a feature that enables the proxy
server to use an application to generate an HTTP error response. With this
capability, the administrator can return a polished error page when the proxy
server generates an error, or when a content server returns an unsuccessful
response.
The following action describes scenarios for how the error page policy
is used when it is configured:
- Internal error
- The client sends the following request to the proxy server: GET
/house/rooms/kitchen.jpg HTTP/1.1.
- The proxy server generates an internal error because no servers map to
the request (HTTP 404 – File not found).
- The error policy is configured to handle HTTP 404 responses, so it sends
a request to the error page application to retrieve error content to send
to the client. The request URI and HTTP response code are included as query
parameters in the request to the error page application. If the configured
error page application URI is /ErrorPageApp/ErrorPage, then the request URI
to the error page application is: /ErrorPageApp/ErrorPage?responseCode=404&uri=/house/rooms/kitchen.jpg.
The query parameters “responseCode” and “uri” are sent to the error page
application by default.
- The proxy server returns an HTTP 404 response with content from the error
page application.
- Remote error
- The client sends the following request to the proxy server: GET
/house/rooms/kitchen.jpg HTTP/1.1
- The proxy server forwards the request to the homeserver.companyx.com content
server.
- The homeserver.companyx.com content server is unable to locate
the /house/rooms/kitchen.jpg file and sends an HTTP 404 response
(File not found) to the proxy server.
- The error policy is configured to handle HTTP 404 responses, so it sends
a request to the error page application to retrieve error content to send
to the client. The request URI and HTTP response code are included as query
parameters in the request to the error page application. If the configured
error page application URI is /ErrorPageApp/ErrorPage, then the request
URI to the error page application is: /ErrorPageApp/ErrorPage?responseCode=404&uri=/house/rooms/kitchen.jpg.
The query parameters “responseCode” and “uri” are sent to the error page
application by default.
- The proxy server returns an HTTP 404 response with content from the error
page application.
A sample error application is available in the <WAS_INSTALL_ROOT>/installableApps/HttpErrorHandler.ear file.