url is changed in ngx_http_internal_redirect, but some flags like
r->valid_unparsed_uri
are not always reset. Then in ngx_http_proxy_create_request the
original uri is sent to
backends instead of the new one.
This affects the redirects in ngx_http_core_try_files_phase and
ngx_http_send_error_page.
simple fix:
diff -ruN nginx-1.1.11/src/http/ngx_http_core_module.c
nginx-1.1.11_zls/src/http/ngx_http_core_module.c
--- nginx-1.1.11/src/http/ngx_http_core_module.c 2011-12-06
21:23:37.000000000 +0800
+++ nginx-1.1.11_zls/src/http/ngx_http_core_module.c 2011-12-16
16:31:27.751927635 +0800
@@ -2481,6 +2481,8 @@
r->uri = *uri;
+ r->valid_unparsed_uri = 0;
+
if (args) {
r->args = *args;
diff -ruN nginx-1.1.11/src/http/ngx_http_upstream.c
nginx-1.1.11_zls/src/http/ngx_http_upstream.c
--- nginx-1.1.11/src/http/ngx_http_upstream.c 2011-12-09
21:19:57.000000000 +0800
+++ nginx-1.1.11_zls/src/http/ngx_http_upstream.c 2011-12-16
16:30:25.399218885 +0800
@@ -1895,8 +1895,6 @@
r->method = NGX_HTTP_GET;
}
- r->valid_unparsed_uri = 0;
-
ngx_http_internal_redirect(r, uri, &args);
ngx_http_finalize_request(r, NGX_DONE);
return NGX_DONE;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel