aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_special_response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r--src/http/ngx_http_special_response.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index dfff64107..abdf62482 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -336,9 +336,11 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
}
}
+ r->headers_out.content_type.len = 0;
+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (r->err_ctx == NULL && clcf->error_pages) {
+ if (clcf->error_pages) {
err_page = clcf->error_pages->elts;
@@ -346,7 +348,6 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
if (err_page[i].status == error) {
r->err_status = err_page[i].overwrite;
- r->err_ctx = r->ctx;
r->method = NGX_HTTP_GET;
@@ -370,9 +371,10 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
ngx_list_push(&r->headers_out.headers);
if (r->headers_out.location) {
- r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
error = NGX_HTTP_MOVED_TEMPORARILY;
+ r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
+
r->headers_out.location->hash = 1;
r->headers_out.location->key.len = sizeof("Location") - 1;
r->headers_out.location->key.data = (u_char *) "Location";