aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-12-18 16:02:44 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-12-18 16:02:44 +0000
commit43f279dc9c57673ffdf6058590ee16f798fb0b24 (patch)
tree70f1073e0a266f1888469712709df3817dc2df1b /src/http/modules/ngx_http_proxy_module.c
parentd10f2fb86f787f8e5bffd5877f2a0cf72afb1d55 (diff)
downloadnginx-43f279dc9c57673ffdf6058590ee16f798fb0b24.tar.gz
nginx-43f279dc9c57673ffdf6058590ee16f798fb0b24.zip
nginx-0.3.17-RELEASE importrelease-0.3.17
*) 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.
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c9
1 files changed, 6 insertions, 3 deletions
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);