]> git.kaiwu.me - nginx.git/commitdiff
allow to handle 301/302 in error_page
authorIgor Sysoev <igor@sysoev.ru>
Wed, 23 Dec 2009 15:31:16 +0000 (15:31 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 23 Dec 2009 15:31:16 +0000 (15:31 +0000)
src/http/ngx_http_core_module.c
src/http/ngx_http_upstream.c

index 83779a455beb046c0825fa33575bde14c2ad7a07..f3b62d9d4a8dcbb178aff3bd9695f8fb20adf28a 100644 (file)
@@ -3900,9 +3900,9 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             return NGX_CONF_ERROR;
         }
 
-        if (err->status < 400 || err->status > 599) {
+        if (err->status < 300 || err->status > 599) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "value \"%V\" must be between 400 and 599",
+                               "value \"%V\" must be between 300 and 599",
                                &value[i]);
             return NGX_CONF_ERROR;
         }
index 35bd35f3ae54c6fd2550ddfcd93904df009833c2..fa434898f96e511a1c3206a721ddb56ddbb81f87 100644 (file)
@@ -1548,7 +1548,7 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u)
 
     /* rc == NGX_OK */
 
-    if (u->headers_in.status_n >= NGX_HTTP_BAD_REQUEST) {
+    if (u->headers_in.status_n > NGX_HTTP_SPECIAL_RESPONSE) {
 
         if (r->subrequest_in_memory) {
             u->buffer.last = u->buffer.pos;