Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-11-27 17:31:44 +0300
committerIgor Sysoev <igor@sysoev.ru>2008-11-27 17:31:44 +0300
commit1095ae05c2302781704f2d42739e033a0f6de763 (patch)
tree93912d5c30b6265afb3d24ff19a9991489ce8cee
parent0c937d251f16455264216a90a03c4acd6458c136 (diff)
r2141 merge:
if upstream sent a location header without status use 302
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c7
-rw-r--r--src/http/ngx_http_upstream.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 17e8a3dbf..b2522ae34 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1189,6 +1189,13 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
u->headers_in.status_n = status;
u->headers_in.status_line = *status_line;
+ } else if (u->headers_in.location) {
+ u->headers_in.status_n = 302;
+ u->headers_in.status_line.len =
+ sizeof("302 Moved Temporarily") - 1;
+ u->headers_in.status_line.data =
+ (u_char *) "302 Moved Temporarily";
+
} else {
u->headers_in.status_n = 200;
u->headers_in.status_line.len = sizeof("200 OK") - 1;
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index b18bf477f..3f77c03c4 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -137,7 +137,8 @@ ngx_http_upstream_header_t ngx_http_upstream_headers_in[] = {
ngx_http_upstream_copy_header_line, 0, 0 },
{ ngx_string("Location"),
- ngx_http_upstream_ignore_header_line, 0,
+ ngx_http_upstream_process_header_line,
+ offsetof(ngx_http_upstream_headers_in_t, location),
ngx_http_upstream_rewrite_location, 0, 0 },
{ ngx_string("Refresh"),