# HG changeset patch # User Igor Sysoev # Date 1196164357 0 # Node ID ea681a6a0c618192002edc6af302dff6aacbf50b # Parent cc7a7d0b89e8c91ce4b36ad4a0da9e576fe5804c set r->headers_out.location for non-local redirects diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2609,6 +2609,10 @@ ngx_http_upstream_rewrite_location(ngx_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()