From 8f8839f98db7c44f821e68f28614094e30fb8b22 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 29 Aug 2011 12:56:09 +0000 Subject: Merge of r3964, r3977, r3978: Proxy related fixes: *) finalizing with rc == 0 in unbuffered proxy mode caused nginx to wait for another send_timeout before actually closing client's connection if client timed out while still talking to upstream server *) update r3945 with more descriptive error message *) test length of proxy_pass with variables; patch by Lanshun Zhou --- src/http/modules/ngx_http_fastcgi_module.c | 2 ++ src/http/modules/ngx_http_proxy_module.c | 12 ++++++++---- src/http/modules/ngx_http_scgi_module.c | 2 ++ src/http/modules/ngx_http_uwsgi_module.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/http/modules') diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index 12d5b1d8f..71194fd20 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -2003,6 +2003,8 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf) conf->catch_stderr = NGX_CONF_UNSET_PTR; + ngx_str_set(&conf->upstream.module, "fastcgi"); + return conf; } diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 214fe6a26..495b1743d 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -642,15 +642,17 @@ ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx, return NGX_ERROR; } - if (ngx_strncasecmp(proxy.data, (u_char *) "http://", 7) == 0) { - + if (proxy.len > 7 + && ngx_strncasecmp(proxy.data, (u_char *) "http://", 7) == 0) + { add = 7; port = 80; #if (NGX_HTTP_SSL) - } else if (ngx_strncasecmp(proxy.data, (u_char *) "https://", 8) == 0) { - + } else if (proxy.len > 8 + && ngx_strncasecmp(proxy.data, (u_char *) "https://", 8) == 0) + { add = 8; port = 443; r->upstream->ssl = 1; @@ -1707,6 +1709,8 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf) conf->headers_hash_max_size = NGX_CONF_UNSET_UINT; conf->headers_hash_bucket_size = NGX_CONF_UNSET_UINT; + ngx_str_set(&conf->upstream.module, "proxy"); + return conf; } diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c index d745551f2..c83d77044 100644 --- a/src/http/modules/ngx_http_scgi_module.c +++ b/src/http/modules/ngx_http_scgi_module.c @@ -1030,6 +1030,8 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf) /* "scgi_cyclic_temp_file" is disabled */ conf->upstream.cyclic_temp_file = 0; + ngx_str_set(&conf->upstream.module, "scgi"); + return conf; } diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c index cd3c7c124..a907e53b8 100644 --- a/src/http/modules/ngx_http_uwsgi_module.c +++ b/src/http/modules/ngx_http_uwsgi_module.c @@ -1083,6 +1083,8 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf) /* "uwsgi_cyclic_temp_file" is disabled */ conf->upstream.cyclic_temp_file = 0; + ngx_str_set(&conf->upstream.module, "uwsgi"); + return conf; } -- cgit