Prev: Next: Up: Simple Proxy[Contents][Index]


4.7 Error responses

Another type of internal backends is Error, a backend that generates error responses. It is useful, for instance, to provide a custom error status and/or message when no service matches the request. Normally, for such cases pound generates a standard 503 response (‘Service Unavailable’) with the built-in error page. You can customize this behavior by using as the last service a Service section with Error backend. For example:

Service
    Error 404 "pound/404.html"
End

The first argument specifies the HTTP status code to return. See Error backend, for more info.

The second argument is optional. It supplies the name of a file with the error page to return along with the response. The name may be absolute or relative. In the latter case, the file will be looked up in the include directory, a special directory for storing pound-specific files. See include directory. The file will be read only once, at program startup. If you modify the file and want pound to notice changes, you will have to restart it.

If the second argument is not supplied, the error text is determined by the ErrorFile code statement in the enclosing listener (where code is the HTTP code in question). If it is not supplied, the built-in default text is used. See Error definitions.