という些細な疑問。適当にどっかから撮ってきてるのかと思って探したら案外無くてムキになって探してしまった。↓みたいなやつのことです。
A: nginx/src/http/ngx_http_special_response.c内でハードコーディングされてた。
ngx_http_special_response.c
static char ngx_http_error_403_page[] =
"<html>" CRLF
"<head><title>403 Forbidden</title></head>" CRLF
"<body bgcolor=\"white\">" CRLF
"<center><h1>403 Forbidden</h1></center>" CRLF
;
static char ngx_http_error_404_page[] =
"<html>" CRLF
"<head><title>404 Not Found</title></head>" CRLF
"<body bgcolor=\"white\">" CRLF
"<center><h1>404 Not Found</h1></center>" CRLF
;
こういうのがngx_http_send_special_response
とかいう関数で呼ばれてるらしい(C-fで流し読んだ並感)とりあえず出処がわかってなるほど、と落ち着いたが案外こういう疑問の掘り下げでソースコード・リーディング進めたほうがいいのかもなあと少し。漫然に読むって言ってもダレること多いしね。