changeset 3860:39ad979cd31e

fix "error_page 497 https://" case patch by Maxim Dounin the bug has been introduced in r3782
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Feb 2011 16:18:55 +0000
parents 30d4d6187316
children cf80c0b0109a
files src/http/ngx_http_special_response.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -570,7 +570,14 @@ ngx_http_send_error_page(ngx_http_reques
         return NGX_ERROR;
     }
 
-    r->err_status = overwrite > 0 ? overwrite : NGX_HTTP_MOVED_TEMPORARILY;
+    if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY
+        && overwrite <= NGX_HTTP_SEE_OTHER)
+    {
+        r->err_status = overwrite;
+
+    } else {
+        r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
+    }
 
     location->hash = 1;
     ngx_str_set(&location->key, "Location");