leave HEAD method while error_page redirection
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index 4e045c7..8493268 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c
@@ -490,8 +490,10 @@ 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); }