comparison src/http/modules/proxy/ngx_http_proxy_upstream.c @ 497:d7c90bb5ce83 release-0.1.23

nginx-0.1.23-RELEASE import *) Feature: the ngx_http_ssi_filter_module and the ssi, ssi_silent_errors, and ssi_min_file_chunk directives. The 'echo var="HTTP_..." default=""' and 'echo var="REMOTE_ADDR"' commands are supported. *) Feature: the %request_time log parameter. *) Feature: if the request has no the "Host" header line, then the "proxy_preserve_host" directive set this header line to the first server name of the "server_name" directive. *) Bugfix: nginx could not be built on platforms different from i386, amd64, sparc, and ppc; the bug had appeared in 0.1.22. *) Bugfix: the ngx_http_autoindex_module now shows the information not about the symlink, but about file or directory it points to. *) Bugfix: the %apache_length parameter logged the negative length of the response header if the no response was transferred to a client.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Mar 2005 15:20:36 +0000
parents 31ff3e943e16
children 64d9afb209da
comparison
equal deleted inserted replaced
496:7ce7b31c3c83 497:d7c90bb5ce83
143 } 143 }
144 144
145 } 145 }
146 146
147 147
148 if (p->lcf->preserve_host && r->headers_in.host) { 148 if (p->lcf->preserve_host) {
149 len += sizeof(host_header) - 1 149 if (r->headers_in.host) {
150 + r->headers_in.host_name_len + sizeof(":") - 1 + uc->port_text.len 150 len += sizeof(host_header) - 1
151 + sizeof(CRLF) - 1; 151 + r->headers_in.host_name_len + sizeof(":") - 1
152 + uc->port_text.len + sizeof(CRLF) - 1;
153
154 } else {
155 len += sizeof(host_header) - 1
156 + r->server_name.len + sizeof(":") - 1
157 + uc->port_text.len + sizeof(CRLF) - 1;
158 }
159
152 } else { 160 } else {
153 len += sizeof(host_header) - 1 + uc->host_header.len 161 len += sizeof(host_header) - 1 + uc->host_header.len
154 + sizeof(CRLF) - 1; 162 + sizeof(CRLF) - 1;
155 } 163 }
156 164
276 284
277 /* the "Host" header */ 285 /* the "Host" header */
278 286
279 b->last = ngx_cpymem(b->last, host_header, sizeof(host_header) - 1); 287 b->last = ngx_cpymem(b->last, host_header, sizeof(host_header) - 1);
280 288
281 if (p->lcf->preserve_host && r->headers_in.host) { 289 if (p->lcf->preserve_host) {
282 b->last = ngx_cpymem(b->last, r->headers_in.host->value.data, 290 if (r->headers_in.host) {
283 r->headers_in.host_name_len); 291 b->last = ngx_cpymem(b->last, r->headers_in.host->value.data,
292 r->headers_in.host_name_len);
293 } else {
294 b->last = ngx_cpymem(b->last, r->server_name.data,
295 r->server_name.len);
296 }
284 297
285 if (!uc->default_port) { 298 if (!uc->default_port) {
286 *b->last++ = ':'; 299 *b->last++ = ':';
287 b->last = ngx_cpymem(b->last, uc->port_text.data, 300 b->last = ngx_cpymem(b->last, uc->port_text.data,
288 uc->port_text.len); 301 uc->port_text.len);