Mercurial > hg > nginx
comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 396:6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 18 Jul 2004 19:11:20 +0000 |
parents | 73688d5d7fc3 |
children | 0526206251f6 |
comparison
equal
deleted
inserted
replaced
395:f8f0f1834266 | 396:6f3b20c1ac50 |
---|---|
1060 char *err; | 1060 char *err; |
1061 u_char *host; | 1061 u_char *host; |
1062 in_addr_t addr; | 1062 in_addr_t addr; |
1063 ngx_str_t *value; | 1063 ngx_str_t *value; |
1064 struct hostent *h; | 1064 struct hostent *h; |
1065 ngx_http_conf_ctx_t *ctx; | |
1066 ngx_http_core_loc_conf_t *clcf; | 1065 ngx_http_core_loc_conf_t *clcf; |
1067 | 1066 |
1068 | 1067 |
1069 value = cf->args->elts; | 1068 value = cf->args->elts; |
1070 | 1069 |
1175 ngx_cpystrn(lcf->peers->peers[0].addr_port_text.data + len, | 1174 ngx_cpystrn(lcf->peers->peers[0].addr_port_text.data + len, |
1176 lcf->upstream->port_text.data, | 1175 lcf->upstream->port_text.data, |
1177 lcf->upstream->port_text.len + 1); | 1176 lcf->upstream->port_text.len + 1); |
1178 } | 1177 } |
1179 | 1178 |
1180 ctx = cf->ctx; | 1179 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); |
1181 clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; | 1180 |
1182 lcf->upstream->location = &clcf->name; | 1181 lcf->upstream->location = &clcf->name; |
1183 clcf->handler = ngx_http_proxy_handler; | 1182 clcf->handler = ngx_http_proxy_handler; |
1183 | |
1184 if (clcf->name.data[clcf->name.len - 1] == '/') { | 1184 if (clcf->name.data[clcf->name.len - 1] == '/') { |
1185 clcf->auto_redirect = 1; | 1185 clcf->auto_redirect = 1; |
1186 } | 1186 } |
1187 | 1187 |
1188 return NULL; | 1188 return NULL; |