From 97c7e1a98621857a5eb2d44c477f7f6384417b52 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 2 Oct 2006 08:37:11 +0000 Subject: [PATCH] fix: "return" always overrode "error_page" response code --- src/http/modules/ngx_http_rewrite_module.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 6db1bc06f..31923755d 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -178,7 +178,11 @@ ngx_http_rewrite_handler(ngx_http_request_t *r) code(e); } - return e->status; + if (r->err_status == 0) { + return e->status; + } + + return r->err_status; }