aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-07-20 11:44:38 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-07-20 11:44:38 +0000
commit5639272d4717a921ab080cdd1bf02fad956dcc77 (patch)
tree8311b3024aa4c19c4ee12ef99bbaa0682b46609d /src/http/modules/ngx_http_proxy_module.c
parent193f9f3b148f5f84f4fc9c8e09601f2c768bdfb0 (diff)
downloadnginx-5639272d4717a921ab080cdd1bf02fad956dcc77.tar.gz
nginx-5639272d4717a921ab080cdd1bf02fad956dcc77.zip
do auto redirect for proxy_pass/fastcgi_pass with variables
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index f2d939ed7..0a512f546 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2592,6 +2592,12 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
+ clcf->handler = ngx_http_proxy_handler;
+
+ if (clcf->name.data[clcf->name.len - 1] == '/') {
+ clcf->auto_redirect = 1;
+ }
+
value = cf->args->elts;
url = &value[1];
@@ -2620,8 +2626,6 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
#endif
- clcf->handler = ngx_http_proxy_handler;
-
return NGX_CONF_OK;
}
@@ -2668,8 +2672,6 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_http_proxy_set_vars(&u, &plcf->vars);
- clcf->handler = ngx_http_proxy_handler;
-
plcf->location = clcf->name;
if (clcf->named
@@ -2693,10 +2695,6 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
plcf->url = *url;
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
return NGX_CONF_OK;
}