diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-05-14 20:51:47 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-05-14 20:51:47 +0400 |
commit | 3043bfcf105e47969720d5bce8c3a89afe8e666d (patch) | |
tree | b96e067363d329f55db34a53d76e6717108d630f /src/http/ngx_http_special_response.c | |
parent | 31f7f6a5410c258e9ad85a4b166804bc57b4c0b9 (diff) |
nginx-0.0.3-2004-05-14-20:51:47 import
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r-- | src/http/ngx_http_special_response.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index 55f4bb3ac..48963464a 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -166,6 +166,9 @@ static ngx_str_t error_pages[] = { ngx_null_string, /* 415 */ ngx_string(error_416_page), + ngx_string(error_404_page), /* 498 */ + ngx_null_string, /* 499 */ + ngx_string(error_500_page), ngx_string(error_501_page), ngx_string(error_502_page), @@ -229,13 +232,20 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) /* 3XX */ err = error - NGX_HTTP_MOVED_PERMANENTLY; - } else if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) { + } else if (error < NGX_HTTP_NGX_CODES) { /* 4XX */ err = error - NGX_HTTP_BAD_REQUEST + 3; } else { - /* 5XX */ - err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17; + /* 49X, 5XX */ + err = error - NGX_HTTP_NGX_CODES + 3 + 17; + + switch (error) { + case NGX_HTTP_INVALID_HOST: + r->headers_out.status = NGX_HTTP_NOT_FOUND; + error = NGX_HTTP_NOT_FOUND; + break; + } } if (error_pages[err].len) { |