comparison src/http/ngx_http_core_module.c @ 212:56688ed172c8 NGINX_0_3_53

nginx 0.3.53 *) Change: the "add_header" directive adds the string to 204, 301, and 302 responses. *) Feature: the "server" directive in the "upstream" context supports the "weight" parameter. *) Feature: the "server_name" directive supports the "*" wildcard. *) Feature: nginx supports the request body size more than 2G. *) Bugfix: if a client was successfully authorized using "satisfy_any on", then anyway the message "access forbidden by rule" was written in the log. *) Bugfix: the "PUT" method may erroneously not create a file and return the 409 code. *) Bugfix: if the IMAP/POP3 backend returned an error, then nginx continued proxying anyway.
author Igor Sysoev <http://sysoev.ru>
date Fri, 07 Jul 2006 00:00:00 +0400
parents 3866d57d9cfd
children 0ad9eeb6ac7f
comparison
equal deleted inserted replaced
211:f04a54878110 212:56688ed172c8
240 0, 240 0,
241 NULL }, 241 NULL },
242 242
243 { ngx_string("client_max_body_size"), 243 { ngx_string("client_max_body_size"),
244 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 244 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
245 ngx_conf_set_size_slot, 245 ngx_conf_set_off_slot,
246 NGX_HTTP_LOC_CONF_OFFSET, 246 NGX_HTTP_LOC_CONF_OFFSET,
247 offsetof(ngx_http_core_loc_conf_t, client_max_body_size), 247 offsetof(ngx_http_core_loc_conf_t, client_max_body_size),
248 NULL }, 248 NULL },
249 249
250 { ngx_string("client_body_buffer_size"), 250 { ngx_string("client_body_buffer_size"),
632 } 632 }
633 633
634 } 634 }
635 635
636 if (r->phase == NGX_HTTP_ACCESS_PHASE && r->access_code) { 636 if (r->phase == NGX_HTTP_ACCESS_PHASE && r->access_code) {
637
638 if (r->access_code == NGX_HTTP_FORBIDDEN) {
639 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
640 "access forbidden by rule");
641 }
642
637 ngx_http_finalize_request(r, r->access_code); 643 ngx_http_finalize_request(r, r->access_code);
638 return; 644 return;
639 } 645 }
640 } 646 }
641 647
688 &clcf->name); 694 &clcf->name);
689 695
690 ngx_http_update_location_config(r); 696 ngx_http_update_location_config(r);
691 697
692 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 698 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
693 "http cl:%z max:%uz", 699 "http cl:%O max:%O",
694 r->headers_in.content_length_n, clcf->client_max_body_size); 700 r->headers_in.content_length_n, clcf->client_max_body_size);
695 701
696 if (r->headers_in.content_length_n != -1 702 if (r->headers_in.content_length_n != -1
697 && clcf->client_max_body_size 703 && clcf->client_max_body_size
698 && clcf->client_max_body_size < (size_t) r->headers_in.content_length_n) 704 && clcf->client_max_body_size < r->headers_in.content_length_n)
699 { 705 {
700 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 706 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
701 "client intented to send too large body: %z bytes", 707 "client intented to send too large body: %O bytes",
702 r->headers_in.content_length_n); 708 r->headers_in.content_length_n);
703 709
704 return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE; 710 return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
705 } 711 }
706 712
2013 * lcf->exact_match = 0; 2019 * lcf->exact_match = 0;
2014 * lcf->auto_redirect = 0; 2020 * lcf->auto_redirect = 0;
2015 * lcf->alias = 0; 2021 * lcf->alias = 0;
2016 */ 2022 */
2017 2023
2018 lcf->client_max_body_size = NGX_CONF_UNSET_SIZE; 2024 lcf->client_max_body_size = NGX_CONF_UNSET;
2019 lcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE; 2025 lcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE;
2020 lcf->client_body_timeout = NGX_CONF_UNSET_MSEC; 2026 lcf->client_body_timeout = NGX_CONF_UNSET_MSEC;
2021 lcf->satisfy_any = NGX_CONF_UNSET; 2027 lcf->satisfy_any = NGX_CONF_UNSET;
2022 lcf->internal = NGX_CONF_UNSET; 2028 lcf->internal = NGX_CONF_UNSET;
2023 lcf->client_body_in_file_only = NGX_CONF_UNSET; 2029 lcf->client_body_in_file_only = NGX_CONF_UNSET;
2084 2090
2085 if (conf->post_action.data == NULL) { 2091 if (conf->post_action.data == NULL) {
2086 conf->post_action = prev->post_action; 2092 conf->post_action = prev->post_action;
2087 } 2093 }
2088 2094
2089 ngx_conf_merge_unsigned_value(conf->types_hash_max_size, 2095 ngx_conf_merge_uint_value(conf->types_hash_max_size,
2090 prev->types_hash_max_size, 1024); 2096 prev->types_hash_max_size, 1024);
2091 2097
2092 ngx_conf_merge_unsigned_value(conf->types_hash_bucket_size, 2098 ngx_conf_merge_uint_value(conf->types_hash_bucket_size,
2093 prev->types_hash_bucket_size, 2099 prev->types_hash_bucket_size,
2094 ngx_cacheline_size); 2100 ngx_cacheline_size);
2095 2101
2096 conf->types_hash_bucket_size = ngx_align(conf->types_hash_bucket_size, 2102 conf->types_hash_bucket_size = ngx_align(conf->types_hash_bucket_size,
2097 ngx_cacheline_size); 2103 ngx_cacheline_size);
2098 2104
2099 /* 2105 /*
2173 } 2179 }
2174 2180
2175 ngx_conf_merge_str_value(conf->default_type, 2181 ngx_conf_merge_str_value(conf->default_type,
2176 prev->default_type, "text/plain"); 2182 prev->default_type, "text/plain");
2177 2183
2178 ngx_conf_merge_size_value(conf->client_max_body_size, 2184 ngx_conf_merge_off_value(conf->client_max_body_size,
2179 prev->client_max_body_size, 1 * 1024 * 1024); 2185 prev->client_max_body_size, 1 * 1024 * 1024);
2180 ngx_conf_merge_size_value(conf->client_body_buffer_size, 2186 ngx_conf_merge_size_value(conf->client_body_buffer_size,
2181 prev->client_body_buffer_size, 2187 prev->client_body_buffer_size,
2182 (size_t) 2 * ngx_pagesize); 2188 (size_t) 2 * ngx_pagesize);
2183 ngx_conf_merge_msec_value(conf->client_body_timeout, 2189 ngx_conf_merge_msec_value(conf->client_body_timeout,
2449 2455
2450 for (i = 1; i < cf->args->nelts; i++) { 2456 for (i = 1; i < cf->args->nelts; i++) {
2451 2457
2452 ch = value[i].data[0]; 2458 ch = value[i].data[0];
2453 2459
2460 if (value[i].len == 1 && ch == '*') {
2461 cscf->wildcard = 1;
2462 continue;
2463 }
2464
2454 if (value[i].len == 0 2465 if (value[i].len == 0
2455 || (ch == '*' && (value[i].len < 3 || value[i].data[1] != '.')) 2466 || (ch == '*' && (value[i].len < 3 || value[i].data[1] != '.'))
2456 || (ch == '.' && value[i].len < 2)) 2467 || (ch == '.' && value[i].len < 2))
2457 { 2468 {
2458 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 2469 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,