aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/proxy/ngx_http_proxy_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-19 16:26:41 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-19 16:26:41 +0000
commit160d774afcf3cdd4f999489211eb9d78bf82439a (patch)
tree59227d2698d9c531808a9f3edb708f36707a37f9 /src/http/modules/proxy/ngx_http_proxy_handler.c
parent1b138ed141c0bdb0c9944c1ae70e53682ed2d035 (diff)
downloadnginx-160d774afcf3cdd4f999489211eb9d78bf82439a.tar.gz
nginx-160d774afcf3cdd4f999489211eb9d78bf82439a.zip
nginx-0.0.1-2003-11-19-19:26:41 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_handler.c')
-rw-r--r--src/http/modules/proxy/ngx_http_proxy_handler.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index 7a012c88d..b7487f833 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -524,22 +524,22 @@ void ngx_http_proxy_close_connection(ngx_http_proxy_ctx_t *p)
size_t ngx_http_proxy_log_error(void *data, char *buf, size_t len)
{
- ngx_http_proxy_ctx_t *p = data;
+ ngx_http_proxy_log_ctx_t *ctx = data;
ngx_http_request_t *r;
ngx_peer_connection_t *peer;
- r = p->request;
- peer = &p->upstream->peer;
+ r = ctx->proxy->request;
+ peer = &ctx->proxy->upstream->peer;
return ngx_snprintf(buf, len,
" while %s, client: %s, URL: %s, upstream: %s%s%s%s%s",
- p->action,
+ ctx->proxy->action,
r->connection->addr_text.data,
r->unparsed_uri.data,
peer->peers->peers[peer->cur_peer].addr_port_text.data,
- p->lcf->upstream->uri.data,
- r->uri.data + p->lcf->upstream->location->len,
+ ctx->proxy->lcf->upstream->uri.data,
+ r->uri.data + ctx->proxy->lcf->upstream->location->len,
r->args.len ? "?" : "",
r->args.len ? r->args.data : "");
}
@@ -934,7 +934,9 @@ static char *ngx_http_proxy_set_pass(ngx_conf_t *cf, ngx_command_t *cmd,
clcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
lcf->upstream->location = &clcf->name;
clcf->handler = ngx_http_proxy_handler;
- clcf->auto_redirect = 1;
+ if (clcf->name.data[clcf->name.len - 1] == '/') {
+ clcf->auto_redirect = 1;
+ }
return NULL;
}