comparison src/http/modules/ngx_http_fastcgi_module.c @ 572:ff463db0be31 NGINX_0_8_38

nginx 0.8.38 *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives. *) Feature: now the "rewrite" directive does a redirect automatically if the $scheme variable is used. Thanks to Piotr Sikora. *) Bugfix: now "limit_req" delay directive conforms to the described algorithm. Thanks to Maxim Dounin. *) Bugfix: the $uid_got variable might not be used in the SSI and perl modules.
author Igor Sysoev <http://sysoev.ru>
date Mon, 24 May 2010 00:00:00 +0400
parents 8246d8a2c2be
children 01f2313e34f1
comparison
equal deleted inserted replaced
571:5b59e716792b 572:ff463db0be31
160 #endif 160 #endif
161 161
162 static char *ngx_http_fastcgi_lowat_check(ngx_conf_t *cf, void *post, 162 static char *ngx_http_fastcgi_lowat_check(ngx_conf_t *cf, void *post,
163 void *data); 163 void *data);
164 164
165 static char *ngx_http_fastcgi_upstream_max_fails_unsupported(ngx_conf_t *cf,
166 ngx_command_t *cmd, void *conf);
167 static char *ngx_http_fastcgi_upstream_fail_timeout_unsupported(ngx_conf_t *cf,
168 ngx_command_t *cmd, void *conf);
169
170 165
171 static ngx_conf_post_t ngx_http_fastcgi_lowat_post = 166 static ngx_conf_post_t ngx_http_fastcgi_lowat_post =
172 { ngx_http_fastcgi_lowat_check }; 167 { ngx_http_fastcgi_lowat_check };
173 168
174 169
339 ngx_http_file_cache_set_slot, 334 ngx_http_file_cache_set_slot,
340 0, 335 0,
341 0, 336 0,
342 &ngx_http_fastcgi_module }, 337 &ngx_http_fastcgi_module },
343 338
339 { ngx_string("fastcgi_no_cache"),
340 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
341 ngx_http_no_cache_set_slot,
342 NGX_HTTP_LOC_CONF_OFFSET,
343 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
344 NULL },
345
344 { ngx_string("fastcgi_cache_valid"), 346 { ngx_string("fastcgi_cache_valid"),
345 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 347 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
346 ngx_http_file_cache_valid_set_slot, 348 ngx_http_file_cache_valid_set_slot,
347 NGX_HTTP_LOC_CONF_OFFSET, 349 NGX_HTTP_LOC_CONF_OFFSET,
348 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_valid), 350 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_valid),
396 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 398 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
397 ngx_conf_set_bitmask_slot, 399 ngx_conf_set_bitmask_slot,
398 NGX_HTTP_LOC_CONF_OFFSET, 400 NGX_HTTP_LOC_CONF_OFFSET,
399 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream), 401 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream),
400 &ngx_http_fastcgi_next_upstream_masks }, 402 &ngx_http_fastcgi_next_upstream_masks },
401
402 { ngx_string("fastcgi_upstream_max_fails"),
403 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
404 ngx_http_fastcgi_upstream_max_fails_unsupported,
405 0,
406 0,
407 NULL },
408
409 { ngx_string("fastcgi_upstream_fail_timeout"),
410 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
411 ngx_http_fastcgi_upstream_fail_timeout_unsupported,
412 0,
413 0,
414 NULL },
415 403
416 { ngx_string("fastcgi_param"), 404 { ngx_string("fastcgi_param"),
417 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, 405 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
418 ngx_conf_set_keyval_slot, 406 ngx_conf_set_keyval_slot,
419 NGX_HTTP_LOC_CONF_OFFSET, 407 NGX_HTTP_LOC_CONF_OFFSET,
1940 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1928 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1941 1929
1942 #if (NGX_HTTP_CACHE) 1930 #if (NGX_HTTP_CACHE)
1943 conf->upstream.cache = NGX_CONF_UNSET_PTR; 1931 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1944 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; 1932 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1933 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1945 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; 1934 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1946 #endif 1935 #endif
1947 1936
1948 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; 1937 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
1949 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; 1938 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
2161 conf->upstream.cache_methods = prev->upstream.cache_methods; 2150 conf->upstream.cache_methods = prev->upstream.cache_methods;
2162 } 2151 }
2163 2152
2164 conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; 2153 conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
2165 2154
2155 ngx_conf_merge_ptr_value(conf->upstream.no_cache,
2156 prev->upstream.no_cache, NULL);
2157
2166 ngx_conf_merge_ptr_value(conf->upstream.cache_valid, 2158 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
2167 prev->upstream.cache_valid, NULL); 2159 prev->upstream.cache_valid, NULL);
2168 2160
2169 if (conf->cache_key.value.data == NULL) { 2161 if (conf->cache_key.value.data == NULL) {
2170 conf->cache_key = prev->cache_key; 2162 conf->cache_key = prev->cache_key;
2747 2739
2748 #endif 2740 #endif
2749 2741
2750 return NGX_CONF_OK; 2742 return NGX_CONF_OK;
2751 } 2743 }
2752
2753
2754 static char *
2755 ngx_http_fastcgi_upstream_max_fails_unsupported(ngx_conf_t *cf,
2756 ngx_command_t *cmd, void *conf)
2757 {
2758 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2759 "\"fastcgi_upstream_max_fails\" is not supported, "
2760 "use the \"max_fails\" parameter of the \"server\" directive ",
2761 "inside the \"upstream\" block");
2762
2763 return NGX_CONF_ERROR;
2764 }
2765
2766
2767 static char *
2768 ngx_http_fastcgi_upstream_fail_timeout_unsupported(ngx_conf_t *cf,
2769 ngx_command_t *cmd, void *conf)
2770 {
2771 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2772 "\"fastcgi_upstream_fail_timeout\" is not supported, "
2773 "use the \"fail_timeout\" parameter of the \"server\" directive ",
2774 "inside the \"upstream\" block");
2775
2776 return NGX_CONF_ERROR;
2777 }