Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4378 - trunk/src/http/modules

Anonymous User
December 23, 2011 11:06AM
Author: mdounin
Date: 2011-12-23 16:04:09 +0000 (Fri, 23 Dec 2011)
New Revision: 4378

Log:
Proxy: made proxy_pass with variables more consistent.

If proxy_pass was used with variables and there was no URI component,
nginx always used unparsed URI. This isn't consistent with "no variables"
case, where e.g. rewrites are applied even if there is no URI component.

Fix is to use the same logic in both cases, i.e. only use unparsed URI if
it's valid and request is the main one.


Modified:
trunk/src/http/modules/ngx_http_proxy_module.c

Modified: trunk/src/http/modules/ngx_http_proxy_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_proxy_module.c 2011-12-20 16:20:23 UTC (rev 4377)
+++ trunk/src/http/modules/ngx_http_proxy_module.c 2011-12-23 16:04:09 UTC (rev 4378)
@@ -736,9 +736,6 @@
url.uri.len++;
url.uri.data = p - 1;
}
-
- } else {
- url.uri = r->unparsed_uri;
}

ctx->vars.key_start = u->schema;
@@ -806,7 +803,7 @@
return NGX_ERROR;
}

- if (plcf->proxy_lengths) {
+ if (plcf->proxy_lengths && ctx->vars.uri.len) {

*key = ctx->vars.uri;
u->uri = ctx->vars.uri;
@@ -916,7 +913,7 @@
loc_len = 0;
unparsed_uri = 0;

- if (plcf->proxy_lengths) {
+ if (plcf->proxy_lengths && ctx->vars.uri.len) {
uri_len = ctx->vars.uri.len;

} else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main)
@@ -1022,7 +1019,7 @@

u->uri.data = b->last;

- if (plcf->proxy_lengths) {
+ if (plcf->proxy_lengths && ctx->vars.uri.len) {
b->last = ngx_copy(b->last, ctx->vars.uri.data, ctx->vars.uri.len);

} else if (unparsed_uri) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4378 - trunk/src/http/modules

Anonymous User 1153 December 23, 2011 11:06AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready