Generating Useful Error Pages With Pound

Generating Useful Error Pages With Pound

The service is not available. Please try again later.

This isn’t very helpful to clients who probably have no idea why their site is unreachable. After getting NAT back up and running, I decided to work on replacing this error with something a little more useful.

Pound lets you create error files that will be displayed if all the hosts are unreachable. Just add any of the following strings to the ListenHTTP section of your pound.cfg file (man pound for more info):

Err414 "filename"
    #A file with the text to be displayed if an Error 414 occurs. Default: "Request URI is too long.".
Err500 "filename"
    #A file with the text to be displayed if an Error 500 occurs. Default: "An internal server error occurred. Please try again later.".
Err501 "filename"
    #A file with the text to be displayed if an Error 501 occurs. Default: "This method may not be used.".
Err503 "filename"
    #A file with the text to be displayed if an Error 503 occurs. Default: "The service is not available. Please try again later.".

Pound appears to cache these error files, so you’ll need to restart pound for it to pick up any changes to the error files you specified.

Presenting visitors with a more informative error message will do wonders to ease the stress of any unexpected downtime. I highly recommend it.

Tags: , , ,

Tristan Waddington

I'm currently a senior studying public relations in the UO School of Journalism and Communication. I've been a student web developer at EMU Marketing since summer 2007.

Leave a Reply