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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index 4e045c701..849326839 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -490,8 +490,10 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
if (uri->data[0] == '/') {
- r->method = NGX_HTTP_GET;
- r->method_name = ngx_http_get_name;
+ if (r->method != NGX_HTTP_HEAD) {
+ r->method = NGX_HTTP_GET;
+ r->method_name = ngx_http_get_name;
+ }
return ngx_http_internal_redirect(r, uri, args);
}