]> git.kaiwu.me - nginx.git/commitdiff
set r->headers_out.location for non-local redirects
authorIgor Sysoev <igor@sysoev.ru>
Tue, 27 Nov 2007 11:52:37 +0000 (11:52 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 27 Nov 2007 11:52:37 +0000 (11:52 +0000)
src/http/ngx_http_upstream.c

index 0c36925d9415ede89f8e5bef2ced3296dfb115d3..4502c17994d60184a62e130b2a10b32b7cd304e8 100644 (file)
@@ -2609,6 +2609,10 @@ ngx_http_upstream_rewrite_location(ngx_http_request_t *r, ngx_table_elt_t *h,
         return rc;
     }
 
+    if (ho->value.data[0] != '/') {
+        r->headers_out.location = ho;
+    }
+
     /*
      * we do not set r->headers_out.location here to avoid the handling
      * the local redirects without a host name by ngx_http_header_filter()