comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 16:74b1868dd3cd NGINX_0_1_8

nginx 0.1.8 *) Bugfix: in the ngx_http_autoindex_module if the long file names were in the listing. *) Feature: the "^~" modifier in the location directive. *) Feature: the proxy_max_temp_file_size directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 20 Nov 2004 00:00:00 +0300
parents 46833bd150cb
children 6f8b0dc0f8dd
comparison
equal deleted inserted replaced
15:0503cb60c4e4 16:74b1868dd3cd
162 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234, 162 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
163 ngx_conf_set_path_slot, 163 ngx_conf_set_path_slot,
164 NGX_HTTP_LOC_CONF_OFFSET, 164 NGX_HTTP_LOC_CONF_OFFSET,
165 offsetof(ngx_http_proxy_loc_conf_t, temp_path), 165 offsetof(ngx_http_proxy_loc_conf_t, temp_path),
166 (void *) ngx_garbage_collector_temp_handler }, 166 (void *) ngx_garbage_collector_temp_handler },
167
168 { ngx_string("proxy_max_temp_file_size"),
169 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
170 ngx_conf_set_size_slot,
171 NGX_HTTP_LOC_CONF_OFFSET,
172 offsetof(ngx_http_proxy_loc_conf_t, max_temp_file_size),
173 NULL },
167 174
168 { ngx_string("proxy_temp_file_write_size"), 175 { ngx_string("proxy_temp_file_write_size"),
169 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 176 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
170 ngx_conf_set_size_slot, 177 ngx_conf_set_size_slot,
171 NGX_HTTP_LOC_CONF_OFFSET, 178 NGX_HTTP_LOC_CONF_OFFSET,
952 959
953 conf->header_buffer_size = NGX_CONF_UNSET_SIZE; 960 conf->header_buffer_size = NGX_CONF_UNSET_SIZE;
954 conf->read_timeout = NGX_CONF_UNSET_MSEC; 961 conf->read_timeout = NGX_CONF_UNSET_MSEC;
955 conf->busy_buffers_size = NGX_CONF_UNSET_SIZE; 962 conf->busy_buffers_size = NGX_CONF_UNSET_SIZE;
956 963
957 /* 964 conf->max_temp_file_size = NGX_CONF_UNSET_SIZE;
958 * "proxy_max_temp_file_size" is hardcoded to 1G for reverse proxy,
959 * it should be configurable in the generic proxy
960 */
961 conf->max_temp_file_size = 1024 * 1024 * 1024;
962
963 conf->temp_file_write_size = NGX_CONF_UNSET_SIZE; 965 conf->temp_file_write_size = NGX_CONF_UNSET_SIZE;
964 966
965 /* "proxy_cyclic_temp_file" is disabled */ 967 /* "proxy_cyclic_temp_file" is disabled */
966 conf->cyclic_temp_file = 0; 968 conf->cyclic_temp_file = 0;
967 969
1057 1059
1058 ngx_conf_merge_size_value(conf->max_temp_file_size, 1060 ngx_conf_merge_size_value(conf->max_temp_file_size,
1059 prev->max_temp_file_size, NGX_CONF_UNSET_SIZE); 1061 prev->max_temp_file_size, NGX_CONF_UNSET_SIZE);
1060 1062
1061 if (conf->max_temp_file_size == NGX_CONF_UNSET_SIZE) { 1063 if (conf->max_temp_file_size == NGX_CONF_UNSET_SIZE) {
1064
1065 /*
1066 * "proxy_max_temp_file_size" is set to 1G for reverse proxy,
1067 * it should be much less in the generic proxy
1068 */
1069
1070 conf->max_temp_file_size = 1024 * 1024 * 1024;
1071
1072 #if 0
1062 conf->max_temp_file_size = 2 * size; 1073 conf->max_temp_file_size = 2 * size;
1063 1074 #endif
1064 } else if (conf->max_temp_file_size < size) { 1075
1076
1077 } else if (conf->max_temp_file_size != 0
1078 && conf->max_temp_file_size < size)
1079 {
1065 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1080 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1066 "\"proxy_max_temp_file_size\" must be equal or bigger than " 1081 "\"proxy_max_temp_file_size\" must be equal to zero to disable "
1082 "the temporary files usage or must be equal or bigger than "
1067 "maximum of the value of \"proxy_header_buffer_size\" and " 1083 "maximum of the value of \"proxy_header_buffer_size\" and "
1068 "one of the \"proxy_buffers\""); 1084 "one of the \"proxy_buffers\"");
1069 1085
1070 return NGX_CONF_ERROR; 1086 return NGX_CONF_ERROR;
1071 } 1087 }