comparison src/http/modules/ngx_http_fastcgi_module.c @ 104:146eff53ab60 NGINX_0_2_6

nginx 0.2.6 *) Change: while using load-balancing the time before the failed backend retry was decreased from 60 to 10 seconds. *) Change: the "proxy_pass_unparsed_uri" was canceled, the original URI now passed, if the URI part is omitted in "proxy_pass" directive. *) Feature: the "error_page" directive supports redirects and allows more flexible to change an error code. *) Change: the charset in the "Content-Type" header line now is ignored in proxied subrequests. *) Bugfix: if the URI was changed in the "if" block and request did not found new configuration, then the ngx_http_rewrite_module rules ran again. *) Bugfix: if the "set" directive set the ngx_http_geo_module variable in some configuration part, the this variable was not available in other configuration parts and the "using uninitialized variable" error was occurred; bug appeared in 0.2.2.
author Igor Sysoev <http://sysoev.ru>
date Wed, 05 Oct 2005 00:00:00 +0400
parents ca4f70b3ccc6
children dad2fe8ecf08
comparison
equal deleted inserted replaced
103:acdd83ee07cb 104:146eff53ab60
144 }; 144 };
145 145
146 146
147 static ngx_str_t ngx_http_fastcgi_script_name = 147 static ngx_str_t ngx_http_fastcgi_script_name =
148 ngx_string("fastcgi_script_name"); 148 ngx_string("fastcgi_script_name");
149
150
151 #if (NGX_PCRE)
152 static ngx_str_t ngx_http_fastcgi_uri = ngx_string("/");
153 #endif
154 149
155 150
156 static ngx_conf_post_t ngx_http_fastcgi_lowat_post = 151 static ngx_conf_post_t ngx_http_fastcgi_lowat_post =
157 { ngx_http_fastcgi_lowat_check }; 152 { ngx_http_fastcgi_lowat_check };
158 153
1446 1441
1447 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE; 1442 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
1448 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; 1443 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
1449 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; 1444 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
1450 1445
1451 conf->upstream.pass_unparsed_uri = NGX_CONF_UNSET;
1452 conf->upstream.method = NGX_CONF_UNSET_UINT; 1446 conf->upstream.method = NGX_CONF_UNSET_UINT;
1453 conf->upstream.pass_request_headers = NGX_CONF_UNSET; 1447 conf->upstream.pass_request_headers = NGX_CONF_UNSET;
1454 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1448 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1455 1449
1456 conf->upstream.redirect_errors = NGX_CONF_UNSET; 1450 conf->upstream.redirect_errors = NGX_CONF_UNSET;
1600 ngx_conf_merge_path_value(conf->upstream.temp_path, 1594 ngx_conf_merge_path_value(conf->upstream.temp_path,
1601 prev->upstream.temp_path, 1595 prev->upstream.temp_path,
1602 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0, 1596 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0,
1603 ngx_garbage_collector_temp_handler, cf); 1597 ngx_garbage_collector_temp_handler, cf);
1604 1598
1605 ngx_conf_merge_value(conf->upstream.pass_unparsed_uri,
1606 prev->upstream.pass_unparsed_uri, 0);
1607
1608 if (conf->upstream.pass_unparsed_uri && conf->upstream.location->len > 1) {
1609 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
1610 "\"fastcgi_pass_unparsed_uri\" can be set for "
1611 "location \"/\" or given by regular expression.");
1612 return NGX_CONF_ERROR;
1613 }
1614
1615 if (conf->upstream.method == NGX_CONF_UNSET_UINT) { 1599 if (conf->upstream.method == NGX_CONF_UNSET_UINT) {
1616 conf->upstream.method = prev->upstream.method; 1600 conf->upstream.method = prev->upstream.method;
1617 } 1601 }
1618 1602
1619 ngx_conf_merge_value(conf->upstream.pass_request_headers, 1603 ngx_conf_merge_value(conf->upstream.pass_request_headers,
1810 ngx_http_core_loc_conf_t *clcf; 1794 ngx_http_core_loc_conf_t *clcf;
1811 #if (NGX_HAVE_UNIX_DOMAIN) 1795 #if (NGX_HAVE_UNIX_DOMAIN)
1812 ngx_unix_domain_upstream_t unix_upstream; 1796 ngx_unix_domain_upstream_t unix_upstream;
1813 #endif 1797 #endif
1814 1798
1799 if (lcf->upstream.schema.len) {
1800 return "is duplicate";
1801 }
1802
1815 value = cf->args->elts; 1803 value = cf->args->elts;
1816 1804
1817 if (ngx_strncasecmp(value[1].data, "unix:", 5) == 0) { 1805 if (ngx_strncasecmp(value[1].data, "unix:", 5) == 0) {
1818 1806
1819 #if (NGX_HAVE_UNIX_DOMAIN) 1807 #if (NGX_HAVE_UNIX_DOMAIN)
1825 1813
1826 lcf->peers = ngx_unix_upstream_parse(cf, &unix_upstream); 1814 lcf->peers = ngx_unix_upstream_parse(cf, &unix_upstream);
1827 if (lcf->peers == NULL) { 1815 if (lcf->peers == NULL) {
1828 return NGX_CONF_ERROR; 1816 return NGX_CONF_ERROR;
1829 } 1817 }
1818
1819 lcf->peers->peer[0].uri_separator = "";
1830 1820
1831 #else 1821 #else
1832 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1822 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1833 "the unix domain sockets are not supported " 1823 "the unix domain sockets are not supported "
1834 "on this platform"); 1824 "on this platform");
1848 } 1838 }
1849 } 1839 }
1850 1840
1851 lcf->upstream.schema.len = sizeof("fastcgi://") - 1; 1841 lcf->upstream.schema.len = sizeof("fastcgi://") - 1;
1852 lcf->upstream.schema.data = (u_char *) "fastcgi://"; 1842 lcf->upstream.schema.data = (u_char *) "fastcgi://";
1853 lcf->upstream.uri.len = sizeof("/") - 1;
1854 lcf->upstream.uri.data = (u_char *) "/";
1855 1843
1856 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); 1844 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
1857 1845
1858 clcf->handler = ngx_http_fastcgi_handler; 1846 clcf->handler = ngx_http_fastcgi_handler;
1859 1847
1860 #if (NGX_PCRE)
1861 lcf->upstream.location = clcf->regex ? &ngx_http_fastcgi_uri : &clcf->name;
1862 #else
1863 lcf->upstream.location = &clcf->name; 1848 lcf->upstream.location = &clcf->name;
1864 #endif
1865 1849
1866 if (clcf->name.data[clcf->name.len - 1] == '/') { 1850 if (clcf->name.data[clcf->name.len - 1] == '/') {
1867 clcf->auto_redirect = 1; 1851 clcf->auto_redirect = 1;
1868 } 1852 }
1869 1853