From 43f279dc9c57673ffdf6058590ee16f798fb0b24 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Sun, 18 Dec 2005 16:02:44 +0000 Subject: nginx-0.3.17-RELEASE import *) Change: now on Linux configure checks the presence of epoll and sendfile64() in kernel. *) Feature: the "map" directive supports domain names in the ".domain.tld" form. *) Bugfix: the timeouts were not used in SSL handshake; the bug had appeared in 0.2.4. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. *) Bugfix: when the HTTPS protocol was used in the "proxy_pass" directive the port 80 was used by default. --- src/http/modules/ngx_http_proxy_module.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/http/modules/ngx_http_proxy_module.c') diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index c39f32065..c2be2c44e 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -1926,6 +1926,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) size_t add; ngx_str_t *value, *url; + ngx_uint_t port; ngx_inet_upstream_t inet_upstream; ngx_http_core_loc_conf_t *clcf; #if (NGX_HTTP_SSL) @@ -1945,12 +1946,14 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) if (ngx_strncasecmp(url->data, "http://", 7) == 0) { add = 7; + port = 80; } else if (ngx_strncasecmp(url->data, "https://", 8) == 0) { #if (NGX_HTTP_SSL) add = 8; + port = 443; plcf->upstream.ssl = ngx_pcalloc(cf->pool, sizeof(ngx_ssl_t)); if (plcf->upstream.ssl == NULL) { @@ -2019,7 +2022,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) inet_upstream.name = *url; inet_upstream.url.len = url->len - add; inet_upstream.url.data = url->data + add; - inet_upstream.default_port_value = 80; + inet_upstream.default_port_value = port; inet_upstream.uri_part = 1; plcf->peers = ngx_inet_upstream_parse(cf, &inet_upstream); @@ -2032,8 +2035,8 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) plcf->upstream.uri = inet_upstream.uri; } - plcf->upstream.schema.len = sizeof("http://") - 1; - plcf->upstream.schema.data = (u_char *) "http://"; + plcf->upstream.schema.len = add; + plcf->upstream.schema.data = url->data; clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); -- cgit