comparison src/http/modules/ngx_http_proxy_module.c @ 202:ca5f86d94316 NGINX_0_3_48

nginx 0.3.48 *) Change: now the ngx_http_charset_module works for subrequests, if the response has no "Content-Type" header line. *) Bugfix: if the "proxy_pass" directive has no URI part, then the "proxy_redirect default" directive add the unnecessary slash in start of the rewritten redirect. *) Bugfix: the internal redirect always transform client's HTTP method to GET, now the transformation is made for the "X-Accel-Redirect" redirects only and if the method is not HEAD; bug appeared in 0.3.42. *) Bugfix: the ngx_http_perl_module could not be built, if the perl was built with the threads support; bug appeared in 0.3.46.
author Igor Sysoev <http://sysoev.ru>
date Mon, 29 May 2006 00:00:00 +0400
parents d2ae1c9f1fd3
children 3866d57d9cfd
comparison
equal deleted inserted replaced
201:958c1992c173 202:ca5f86d94316
1347 1347
1348 p = data; 1348 p = data;
1349 1349
1350 p = ngx_copy(p, h->value.data, prefix); 1350 p = ngx_copy(p, h->value.data, prefix);
1351 1351
1352 p = ngx_copy(p, pr->replacement.text.data, pr->replacement.text.len); 1352 if (pr->replacement.text.len) {
1353 p = ngx_copy(p, pr->replacement.text.data, pr->replacement.text.len);
1354 }
1353 1355
1354 ngx_memcpy(p, h->value.data + prefix + pr->redirect.len, 1356 ngx_memcpy(p, h->value.data + prefix + pr->redirect.len,
1355 h->value.len - pr->redirect.len - prefix); 1357 h->value.len - pr->redirect.len - prefix);
1356 1358
1357 h->value.len = len; 1359 h->value.len = len;
1692 return NGX_CONF_ERROR; 1694 return NGX_CONF_ERROR;
1693 } 1695 }
1694 1696
1695 pr->handler = ngx_http_proxy_rewrite_redirect_text; 1697 pr->handler = ngx_http_proxy_rewrite_redirect_text;
1696 pr->redirect = conf->upstream.url; 1698 pr->redirect = conf->upstream.url;
1697 pr->replacement.text = conf->upstream.location; 1699
1700 if (conf->upstream.uri.len) {
1701 pr->replacement.text = conf->upstream.location;
1702
1703 } else {
1704 pr->replacement.text.len = 0;
1705 pr->replacement.text.data = NULL;
1706 }
1698 } 1707 }
1699 } 1708 }
1700 1709
1701 if (conf->upstream.hide_headers == NULL 1710 if (conf->upstream.hide_headers == NULL
1702 && conf->upstream.pass_headers == NULL) 1711 && conf->upstream.pass_headers == NULL)
2261 return NGX_CONF_ERROR; 2270 return NGX_CONF_ERROR;
2262 } 2271 }
2263 2272
2264 pr->handler = ngx_http_proxy_rewrite_redirect_text; 2273 pr->handler = ngx_http_proxy_rewrite_redirect_text;
2265 pr->redirect = plcf->upstream.url; 2274 pr->redirect = plcf->upstream.url;
2266 pr->replacement.text = plcf->upstream.location; 2275
2276 if (plcf->upstream.uri.len) {
2277 pr->replacement.text = plcf->upstream.location;
2278
2279 } else {
2280 pr->replacement.text.len = 0;
2281 pr->replacement.text.data = NULL;
2282 }
2267 2283
2268 return NGX_CONF_OK; 2284 return NGX_CONF_OK;
2269 } 2285 }
2270 2286
2271 if (ngx_http_script_variables_count(&value[2]) == 0) { 2287 if (ngx_http_script_variables_count(&value[2]) == 0) {