]> git.kaiwu.me - nginx.git/commitdiff
fix "error_page 497 https://" case
authorIgor Sysoev <igor@sysoev.ru>
Tue, 1 Feb 2011 16:18:55 +0000 (16:18 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 1 Feb 2011 16:18:55 +0000 (16:18 +0000)
patch by Maxim Dounin
the bug has been introduced in r3782

src/http/ngx_http_special_response.c

index ed87fd068c56ec9c2b31b91e6430d5a8107d6bce..0f08d987e5394eb59a81ccb4161da7185be28b6c 100644 (file)
@@ -570,7 +570,14 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
         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");