Klaus Demo nginx / 64304df
client_body_in_file_only any Igor Sysoev 15 years ago
1 changed file(s) with 19 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2020 #define NGX_HTTP_LOCATION_AUTO_REDIRECT 2
2121 #define NGX_HTTP_LOCATION_NOREGEX 3
2222 #define NGX_HTTP_LOCATION_REGEX 4
23
24
25 #define NGX_HTTP_REQUEST_BODY_FILE_OFF 0
26 #define NGX_HTTP_REQUEST_BODY_FILE_ON 1
27 #define NGX_HTTP_REQUEST_BODY_FILE_ANY 2
2328
2429
2530 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r,
7378 };
7479
7580
81 static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = {
82 { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF },
83 { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON },
84 { ngx_string("any"), NGX_HTTP_REQUEST_BODY_FILE_ANY },
85 { ngx_null_string, 0 }
86 };
87
88
7689 static ngx_command_t ngx_http_core_commands[] = {
7790
7891 { ngx_string("variables_hash_max_size"),
268281
269282 { ngx_string("client_body_in_file_only"),
270283 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
271 ngx_conf_set_flag_slot,
284 ngx_conf_set_enum_slot,
272285 NGX_HTTP_LOC_CONF_OFFSET,
273286 offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only),
274 NULL },
287 &ngx_http_core_request_body_in_file },
275288
276289 { ngx_string("sendfile"),
277290 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
877890 r->request_body_in_file_only = 1;
878891 r->request_body_in_persistent_file = 1;
879892 r->request_body_file_log_level = NGX_LOG_NOTICE;
893
894 if (clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_ON) {
895 r->request_body_delete_incomplete_file = 1;
896 }
880897
881898 } else {
882899 r->request_body_file_log_level = NGX_LOG_WARN;