comparison src/http/modules/ngx_http_fastcgi_module.c @ 110:dad2fe8ecf08 NGINX_0_3_2

nginx 0.3.2 *) Feature: the Sun Studio 10 C compiler support. *) Feature: the "proxy_upstream_max_fails", "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", and "fastcgi_upstream_fail_timeout" directives.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Oct 2005 00:00:00 +0400
parents 146eff53ab60
children d25a1d6034f1
comparison
equal deleted inserted replaced
109:97da525033a1 110:dad2fe8ecf08
149 149
150 150
151 static ngx_conf_post_t ngx_http_fastcgi_lowat_post = 151 static ngx_conf_post_t ngx_http_fastcgi_lowat_post =
152 { ngx_http_fastcgi_lowat_check }; 152 { ngx_http_fastcgi_lowat_check };
153 153
154 static ngx_conf_enum_t ngx_http_fastcgi_set_methods[] = {
155 { ngx_string("get"), NGX_HTTP_GET },
156 { ngx_null_string, 0 }
157 };
158 154
159 static ngx_conf_bitmask_t ngx_http_fastcgi_next_upstream_masks[] = { 155 static ngx_conf_bitmask_t ngx_http_fastcgi_next_upstream_masks[] = {
160 { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR }, 156 { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
161 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, 157 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
162 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, 158 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
208 ngx_conf_set_size_slot, 204 ngx_conf_set_size_slot,
209 NGX_HTTP_LOC_CONF_OFFSET, 205 NGX_HTTP_LOC_CONF_OFFSET,
210 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.header_buffer_size), 206 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.header_buffer_size),
211 NULL }, 207 NULL },
212 208
213 { ngx_string("fastcgi_method"),
214 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
215 ngx_conf_set_enum_slot,
216 NGX_HTTP_LOC_CONF_OFFSET,
217 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.method),
218 ngx_http_fastcgi_set_methods },
219
220 { ngx_string("fastcgi_pass_request_headers"), 209 { ngx_string("fastcgi_pass_request_headers"),
221 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 210 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
222 ngx_conf_set_flag_slot, 211 ngx_conf_set_flag_slot,
223 NGX_HTTP_LOC_CONF_OFFSET, 212 NGX_HTTP_LOC_CONF_OFFSET,
224 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_request_headers), 213 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_request_headers),
291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 280 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
292 ngx_conf_set_bitmask_slot, 281 ngx_conf_set_bitmask_slot,
293 NGX_HTTP_LOC_CONF_OFFSET, 282 NGX_HTTP_LOC_CONF_OFFSET,
294 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream), 283 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream),
295 &ngx_http_fastcgi_next_upstream_masks }, 284 &ngx_http_fastcgi_next_upstream_masks },
285
286 { ngx_string("fastcgi_upstream_max_fails"),
287 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
288 ngx_conf_set_num_slot,
289 NGX_HTTP_LOC_CONF_OFFSET,
290 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.max_fails),
291 NULL },
292
293 { ngx_string("fastcgi_upstream_fail_timeout"),
294 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
295 ngx_conf_set_sec_slot,
296 NGX_HTTP_LOC_CONF_OFFSET,
297 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.fail_timeout),
298 NULL },
296 299
297 { ngx_string("fastcgi_param"), 300 { ngx_string("fastcgi_param"),
298 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, 301 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
299 ngx_conf_set_table_elt_slot, 302 ngx_conf_set_table_elt_slot,
300 NGX_HTTP_LOC_CONF_OFFSET, 303 NGX_HTTP_LOC_CONF_OFFSET,
1441 1444
1442 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE; 1445 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
1443 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; 1446 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
1444 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; 1447 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
1445 1448
1446 conf->upstream.method = NGX_CONF_UNSET_UINT; 1449 conf->upstream.max_fails = NGX_CONF_UNSET_UINT;
1450 conf->upstream.fail_timeout = NGX_CONF_UNSET;
1451
1447 conf->upstream.pass_request_headers = NGX_CONF_UNSET; 1452 conf->upstream.pass_request_headers = NGX_CONF_UNSET;
1448 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1453 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1449 1454
1450 conf->upstream.redirect_errors = NGX_CONF_UNSET; 1455 conf->upstream.redirect_errors = NGX_CONF_UNSET;
1451 1456
1589 prev->upstream.next_upstream, 1594 prev->upstream.next_upstream,
1590 (NGX_CONF_BITMASK_SET 1595 (NGX_CONF_BITMASK_SET
1591 |NGX_HTTP_UPSTREAM_FT_ERROR 1596 |NGX_HTTP_UPSTREAM_FT_ERROR
1592 |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); 1597 |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
1593 1598
1599 ngx_conf_merge_unsigned_value(conf->upstream.max_fails,
1600 prev->upstream.max_fails, 1);
1601
1602 ngx_conf_merge_sec_value(conf->upstream.fail_timeout,
1603 prev->upstream.fail_timeout, 10);
1604
1605 if (conf->peers && conf->peers->number > 1) {
1606 for (i = 0; i < conf->peers->number; i++) {
1607 conf->peers->peer[i].weight = 1;
1608 conf->peers->peer[i].max_fails = conf->upstream.max_fails;
1609 conf->peers->peer[i].fail_timeout = conf->upstream.fail_timeout;
1610 }
1611 }
1612
1594 ngx_conf_merge_path_value(conf->upstream.temp_path, 1613 ngx_conf_merge_path_value(conf->upstream.temp_path,
1595 prev->upstream.temp_path, 1614 prev->upstream.temp_path,
1596 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0, 1615 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0,
1597 ngx_garbage_collector_temp_handler, cf); 1616 ngx_garbage_collector_temp_handler, cf);
1598
1599 if (conf->upstream.method == NGX_CONF_UNSET_UINT) {
1600 conf->upstream.method = prev->upstream.method;
1601 }
1602 1617
1603 ngx_conf_merge_value(conf->upstream.pass_request_headers, 1618 ngx_conf_merge_value(conf->upstream.pass_request_headers,
1604 prev->upstream.pass_request_headers, 1); 1619 prev->upstream.pass_request_headers, 1);
1605 ngx_conf_merge_value(conf->upstream.pass_request_body, 1620 ngx_conf_merge_value(conf->upstream.pass_request_body,
1606 prev->upstream.pass_request_body, 1); 1621 prev->upstream.pass_request_body, 1);