You need to set the following the config file:
#
# Internal redirects
#
ns_section "ns/server/${server}/redirects"
ns_param 404 "/global/notfound.html" ;# Not Found error page
ns_param 403 "/global/forbidden.html" ;# Forbidden error page
ns_param 500 "/global/servererror.html" ;# Server error page
If you want to use templating then you will need to modify the request processor.