Mercurial > hg > nginx
comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 288:f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 14 Mar 2004 20:46:25 +0000 |
parents | 35a6a9df2d25 |
children | 87e73f067470 |
comparison
equal
deleted
inserted
replaced
287:35a6a9df2d25 | 288:f81d075ad172 |
---|---|
77 { ngx_string("proxy_send_timeout"), | 77 { ngx_string("proxy_send_timeout"), |
78 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | 78 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
79 ngx_conf_set_msec_slot, | 79 ngx_conf_set_msec_slot, |
80 NGX_HTTP_LOC_CONF_OFFSET, | 80 NGX_HTTP_LOC_CONF_OFFSET, |
81 offsetof(ngx_http_proxy_loc_conf_t, send_timeout), | 81 offsetof(ngx_http_proxy_loc_conf_t, send_timeout), |
82 NULL }, | |
83 | |
84 { ngx_string("proxy_preserve_host"), | |
85 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
86 ngx_conf_set_flag_slot, | |
87 NGX_HTTP_LOC_CONF_OFFSET, | |
88 offsetof(ngx_http_proxy_loc_conf_t, preserve_host), | |
82 NULL }, | 89 NULL }, |
83 | 90 |
84 { ngx_string("proxy_set_x_real_ip"), | 91 { ngx_string("proxy_set_x_real_ip"), |
85 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 92 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
86 ngx_conf_set_flag_slot, | 93 ngx_conf_set_flag_slot, |
772 | 779 |
773 conf->request_buffer_size = NGX_CONF_UNSET; | 780 conf->request_buffer_size = NGX_CONF_UNSET; |
774 conf->connect_timeout = NGX_CONF_UNSET; | 781 conf->connect_timeout = NGX_CONF_UNSET; |
775 conf->send_timeout = NGX_CONF_UNSET; | 782 conf->send_timeout = NGX_CONF_UNSET; |
776 | 783 |
784 conf->preserve_host = NGX_CONF_UNSET; | |
777 conf->set_x_real_ip = NGX_CONF_UNSET; | 785 conf->set_x_real_ip = NGX_CONF_UNSET; |
778 conf->add_x_forwarded_for = NGX_CONF_UNSET; | 786 conf->add_x_forwarded_for = NGX_CONF_UNSET; |
779 | 787 |
780 conf->header_buffer_size = NGX_CONF_UNSET; | 788 conf->header_buffer_size = NGX_CONF_UNSET; |
781 conf->read_timeout = NGX_CONF_UNSET; | 789 conf->read_timeout = NGX_CONF_UNSET; |
814 prev->request_buffer_size, 8192); | 822 prev->request_buffer_size, 8192); |
815 ngx_conf_merge_msec_value(conf->connect_timeout, | 823 ngx_conf_merge_msec_value(conf->connect_timeout, |
816 prev->connect_timeout, 60000); | 824 prev->connect_timeout, 60000); |
817 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 30000); | 825 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 30000); |
818 | 826 |
827 ngx_conf_merge_value(conf->preserve_host, prev->preserve_host, 0); | |
819 ngx_conf_merge_value(conf->set_x_real_ip, prev->set_x_real_ip, 0); | 828 ngx_conf_merge_value(conf->set_x_real_ip, prev->set_x_real_ip, 0); |
820 ngx_conf_merge_value(conf->add_x_forwarded_for, | 829 ngx_conf_merge_value(conf->add_x_forwarded_for, |
821 prev->add_x_forwarded_for, 0); | 830 prev->add_x_forwarded_for, 0); |
822 | 831 |
823 ngx_conf_merge_size_value(conf->header_buffer_size, | 832 ngx_conf_merge_size_value(conf->header_buffer_size, |
1055 if (u->host.len == 0) { | 1064 if (u->host.len == 0) { |
1056 u->host.len = i; | 1065 u->host.len = i; |
1057 } | 1066 } |
1058 | 1067 |
1059 if (u->port_text.data == NULL) { | 1068 if (u->port_text.data == NULL) { |
1069 u->default_port = 1; | |
1060 u->port = htons(80); | 1070 u->port = htons(80); |
1061 u->port_text.len = 2; | 1071 u->port_text.len = 2; |
1062 u->port_text.data = "80"; | 1072 u->port_text.data = "80"; |
1063 return NULL; | 1073 return NULL; |
1064 } | 1074 } |
1085 | 1095 |
1086 u->uri.data = "/"; | 1096 u->uri.data = "/"; |
1087 u->uri.len = 1; | 1097 u->uri.len = 1; |
1088 | 1098 |
1089 if (u->port_text.data == NULL) { | 1099 if (u->port_text.data == NULL) { |
1100 u->default_port = 1; | |
1090 u->port = htons(80); | 1101 u->port = htons(80); |
1091 u->port_text.len = 2; | 1102 u->port_text.len = 2; |
1092 u->port_text.data = "80"; | 1103 u->port_text.data = "80"; |
1093 return NULL; | 1104 return NULL; |
1094 } | 1105 } |