comparison src/http/modules/ngx_http_proxy_module.c @ 496:116d5de7cbb6 NGINX_0_7_60

nginx 0.7.60 *) Feature: the "updating" parameter in "proxy_cache_use_stale" and "fastcgi_cache_use_stale" directives. *) Feature: the "keepalive_requests" directive. *) Bugfix: in open_file_cache and proxy/fastcgi cache interaction on start up. *) Bugfix: open_file_cache might cache open file descriptors too long. *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request header lines were passed to backend while caching if no "proxy_set_header" directive was used with any parameters. *) Bugfix: the "Set-Cookie" and "P3P" response header lines were not hidden while caching if no "proxy_hide_header/fastcgi_hide_header" directives were used with any parameters. *) Bugfix: the ngx_http_image_filter_module did not support GIF87a format. Thanks to Denis Ilyinyh. *) Bugfix: nginx could not be built modules on Solaris 10 and early; the bug had appeared in 0.7.56. *) Bugfix: XLST filter did not work in subrequests. *) Bugfix: in relative paths handling in nginx/Windows. *) Bugfix: in proxy_store, fastcgi_store, proxy_cache, and fastcgi_cache in nginx/Windows.
author Igor Sysoev <http://sysoev.ru>
date Mon, 15 Jun 2009 00:00:00 +0400
parents 499474178a11
children ef5c97e49c35
comparison
equal deleted inserted replaced
495:6d9fb4461113 496:116d5de7cbb6
165 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, 165 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
166 { ngx_string("http_502"), NGX_HTTP_UPSTREAM_FT_HTTP_502 }, 166 { ngx_string("http_502"), NGX_HTTP_UPSTREAM_FT_HTTP_502 },
167 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, 167 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
168 { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 }, 168 { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 },
169 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, 169 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
170 { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
170 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, 171 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
171 { ngx_null_string, 0 } 172 { ngx_null_string, 0 }
172 }; 173 };
173 174
174 175
1971 ngx_http_proxy_redirect_t *pr; 1972 ngx_http_proxy_redirect_t *pr;
1972 ngx_http_script_compile_t sc; 1973 ngx_http_script_compile_t sc;
1973 1974
1974 if (conf->upstream.store != 0) { 1975 if (conf->upstream.store != 0) {
1975 ngx_conf_merge_value(conf->upstream.store, 1976 ngx_conf_merge_value(conf->upstream.store,
1976 prev->upstream.store, 0); 1977 prev->upstream.store, 0);
1977 1978
1978 if (conf->upstream.store_lengths == NULL) { 1979 if (conf->upstream.store_lengths == NULL) {
1979 conf->upstream.store_lengths = prev->upstream.store_lengths; 1980 conf->upstream.store_lengths = prev->upstream.store_lengths;
1980 conf->upstream.store_values = prev->upstream.store_values; 1981 conf->upstream.store_values = prev->upstream.store_values;
1981 } 1982 }
2339 conf->headers_set = prev->headers_set; 2340 conf->headers_set = prev->headers_set;
2340 conf->headers_set_hash = prev->headers_set_hash; 2341 conf->headers_set_hash = prev->headers_set_hash;
2341 conf->headers_source = prev->headers_source; 2342 conf->headers_source = prev->headers_source;
2342 } 2343 }
2343 2344
2344 if (conf->headers_set_hash.buckets) { 2345 if (conf->headers_set_hash.buckets
2346 && ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL)))
2347 {
2345 return NGX_OK; 2348 return NGX_OK;
2346 } 2349 }
2347 2350
2348 2351
2349 conf->headers_names = ngx_array_create(cf->pool, 4, sizeof(ngx_hash_key_t)); 2352 conf->headers_names = ngx_array_create(cf->pool, 4, sizeof(ngx_hash_key_t));
2807 ngx_http_proxy_loc_conf_t *plcf = conf; 2810 ngx_http_proxy_loc_conf_t *plcf = conf;
2808 2811
2809 ngx_str_t *value; 2812 ngx_str_t *value;
2810 ngx_http_script_compile_t sc; 2813 ngx_http_script_compile_t sc;
2811 2814
2812 if (plcf->upstream.store != NGX_CONF_UNSET || plcf->upstream.store_lengths) 2815 if (plcf->upstream.store != NGX_CONF_UNSET
2816 || plcf->upstream.store_lengths)
2813 { 2817 {
2814 return "is duplicate"; 2818 return "is duplicate";
2815 } 2819 }
2816 2820
2817 value = cf->args->elts; 2821 value = cf->args->elts;
2818 2822
2823 if (ngx_strcmp(value[1].data, "off") == 0) {
2824 plcf->upstream.store = 0;
2825 return NGX_CONF_OK;
2826 }
2827
2828 #if (NGX_HTTP_CACHE)
2829
2830 if (plcf->upstream.cache != NGX_CONF_UNSET_PTR
2831 && plcf->upstream.cache != NULL)
2832 {
2833 return "is incompatible with \"proxy_cache\"";
2834 }
2835
2836 #endif
2837
2819 if (ngx_strcmp(value[1].data, "on") == 0) { 2838 if (ngx_strcmp(value[1].data, "on") == 0) {
2820 plcf->upstream.store = 1; 2839 plcf->upstream.store = 1;
2821 return NGX_CONF_OK;
2822 }
2823
2824 if (ngx_strcmp(value[1].data, "off") == 0) {
2825 plcf->upstream.store = 0;
2826 return NGX_CONF_OK; 2840 return NGX_CONF_OK;
2827 } 2841 }
2828 2842
2829 /* include the terminating '\0' into script */ 2843 /* include the terminating '\0' into script */
2830 value[1].len++; 2844 value[1].len++;
2863 } 2877 }
2864 2878
2865 if (ngx_strcmp(value[1].data, "off") == 0) { 2879 if (ngx_strcmp(value[1].data, "off") == 0) {
2866 plcf->upstream.cache = NULL; 2880 plcf->upstream.cache = NULL;
2867 return NGX_CONF_OK; 2881 return NGX_CONF_OK;
2882 }
2883
2884 if (plcf->upstream.store > 0 || plcf->upstream.store_lengths) {
2885 return "is incompatible with \"proxy_store\"";
2868 } 2886 }
2869 2887
2870 plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, 2888 plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
2871 &ngx_http_proxy_module); 2889 &ngx_http_proxy_module);
2872 if (plcf->upstream.cache == NULL) { 2890 if (plcf->upstream.cache == NULL) {