Mercurial > hg > nginx
comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 191:71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 19 Nov 2003 16:26:41 +0000 |
parents | 02a715e85df1 |
children | dd66383796a5 |
comparison
equal
deleted
inserted
replaced
190:02a715e85df1 | 191:71ce40b3c37b |
---|---|
522 } | 522 } |
523 | 523 |
524 | 524 |
525 size_t ngx_http_proxy_log_error(void *data, char *buf, size_t len) | 525 size_t ngx_http_proxy_log_error(void *data, char *buf, size_t len) |
526 { | 526 { |
527 ngx_http_proxy_ctx_t *p = data; | 527 ngx_http_proxy_log_ctx_t *ctx = data; |
528 | 528 |
529 ngx_http_request_t *r; | 529 ngx_http_request_t *r; |
530 ngx_peer_connection_t *peer; | 530 ngx_peer_connection_t *peer; |
531 | 531 |
532 r = p->request; | 532 r = ctx->proxy->request; |
533 peer = &p->upstream->peer; | 533 peer = &ctx->proxy->upstream->peer; |
534 | 534 |
535 return ngx_snprintf(buf, len, | 535 return ngx_snprintf(buf, len, |
536 " while %s, client: %s, URL: %s, upstream: %s%s%s%s%s", | 536 " while %s, client: %s, URL: %s, upstream: %s%s%s%s%s", |
537 p->action, | 537 ctx->proxy->action, |
538 r->connection->addr_text.data, | 538 r->connection->addr_text.data, |
539 r->unparsed_uri.data, | 539 r->unparsed_uri.data, |
540 peer->peers->peers[peer->cur_peer].addr_port_text.data, | 540 peer->peers->peers[peer->cur_peer].addr_port_text.data, |
541 p->lcf->upstream->uri.data, | 541 ctx->proxy->lcf->upstream->uri.data, |
542 r->uri.data + p->lcf->upstream->location->len, | 542 r->uri.data + ctx->proxy->lcf->upstream->location->len, |
543 r->args.len ? "?" : "", | 543 r->args.len ? "?" : "", |
544 r->args.len ? r->args.data : ""); | 544 r->args.len ? r->args.data : ""); |
545 } | 545 } |
546 | 546 |
547 | 547 |
932 | 932 |
933 ctx = cf->ctx; | 933 ctx = cf->ctx; |
934 clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; | 934 clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; |
935 lcf->upstream->location = &clcf->name; | 935 lcf->upstream->location = &clcf->name; |
936 clcf->handler = ngx_http_proxy_handler; | 936 clcf->handler = ngx_http_proxy_handler; |
937 clcf->auto_redirect = 1; | 937 if (clcf->name.data[clcf->name.len - 1] == '/') { |
938 clcf->auto_redirect = 1; | |
939 } | |
938 | 940 |
939 return NULL; | 941 return NULL; |
940 } | 942 } |
941 | 943 |
942 | 944 |