1e18a033bSKonstantin Ananyev
2e18a033bSKonstantin Ananyev/*
3e18a033bSKonstantin Ananyev * Copyright (C) Igor Sysoev
4e18a033bSKonstantin Ananyev * Copyright (C) Nginx, Inc.
5e18a033bSKonstantin Ananyev */
6e18a033bSKonstantin Ananyev
7e18a033bSKonstantin Ananyev
8e18a033bSKonstantin Ananyev#include <ngx_config.h>
9e18a033bSKonstantin Ananyev#include <ngx_core.h>
10e18a033bSKonstantin Ananyev#include <ngx_http.h>
11e18a033bSKonstantin Ananyev
12e18a033bSKonstantin Ananyev
13e18a033bSKonstantin Ananyevtypedef struct {
14e18a033bSKonstantin Ananyev    u_char    *name;
15e18a033bSKonstantin Ananyev    uint32_t   method;
16e18a033bSKonstantin Ananyev} ngx_http_method_name_t;
17e18a033bSKonstantin Ananyev
18e18a033bSKonstantin Ananyev
19e18a033bSKonstantin Ananyev#define NGX_HTTP_REQUEST_BODY_FILE_OFF    0
20e18a033bSKonstantin Ananyev#define NGX_HTTP_REQUEST_BODY_FILE_ON     1
21e18a033bSKonstantin Ananyev#define NGX_HTTP_REQUEST_BODY_FILE_CLEAN  2
22e18a033bSKonstantin Ananyev
23e18a033bSKonstantin Ananyev
24e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r);
25e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_core_find_static_location(ngx_http_request_t *r,
26e18a033bSKonstantin Ananyev    ngx_http_location_tree_node_t *node);
27e18a033bSKonstantin Ananyev
28e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf);
29e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_core_postconfiguration(ngx_conf_t *cf);
30e18a033bSKonstantin Ananyevstatic void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
31e18a033bSKonstantin Ananyevstatic char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf);
32e18a033bSKonstantin Ananyevstatic void *ngx_http_core_create_srv_conf(ngx_conf_t *cf);
33e18a033bSKonstantin Ananyevstatic char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf,
34e18a033bSKonstantin Ananyev    void *parent, void *child);
35e18a033bSKonstantin Ananyevstatic void *ngx_http_core_create_loc_conf(ngx_conf_t *cf);
36e18a033bSKonstantin Ananyevstatic char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
37e18a033bSKonstantin Ananyev    void *parent, void *child);
38e18a033bSKonstantin Ananyev
39e18a033bSKonstantin Ananyevstatic char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd,
40e18a033bSKonstantin Ananyev    void *dummy);
41e18a033bSKonstantin Ananyevstatic char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd,
42e18a033bSKonstantin Ananyev    void *dummy);
43e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_core_regex_location(ngx_conf_t *cf,
44e18a033bSKonstantin Ananyev    ngx_http_core_loc_conf_t *clcf, ngx_str_t *regex, ngx_uint_t caseless);
45e18a033bSKonstantin Ananyev
46e18a033bSKonstantin Ananyevstatic char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd,
47e18a033bSKonstantin Ananyev    void *conf);
48e18a033bSKonstantin Ananyevstatic char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy,
49e18a033bSKonstantin Ananyev    void *conf);
50e18a033bSKonstantin Ananyev
51e18a033bSKonstantin Ananyevstatic char *ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd,
52e18a033bSKonstantin Ananyev    void *conf);
53e18a033bSKonstantin Ananyevstatic char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
54e18a033bSKonstantin Ananyev    void *conf);
55e18a033bSKonstantin Ananyevstatic char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
56e18a033bSKonstantin Ananyevstatic char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd,
57e18a033bSKonstantin Ananyev    void *conf);
58e18a033bSKonstantin Ananyevstatic char *ngx_http_core_set_aio(ngx_conf_t *cf, ngx_command_t *cmd,
59e18a033bSKonstantin Ananyev    void *conf);
60e18a033bSKonstantin Ananyevstatic char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd,
61e18a033bSKonstantin Ananyev    void *conf);
62e18a033bSKonstantin Ananyevstatic char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
63e18a033bSKonstantin Ananyev    void *conf);
64e18a033bSKonstantin Ananyevstatic char *ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd,
65e18a033bSKonstantin Ananyev    void *conf);
66e18a033bSKonstantin Ananyevstatic char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
67e18a033bSKonstantin Ananyev    void *conf);
68e18a033bSKonstantin Ananyevstatic char *ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd,
69e18a033bSKonstantin Ananyev    void *conf);
70e18a033bSKonstantin Ananyevstatic char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
71e18a033bSKonstantin Ananyev    void *conf);
72e18a033bSKonstantin Ananyevstatic char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd,
73e18a033bSKonstantin Ananyev    void *conf);
74e18a033bSKonstantin Ananyevstatic char *ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
75e18a033bSKonstantin Ananyev    void *conf);
76e18a033bSKonstantin Ananyev#if (NGX_HTTP_GZIP)
77e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_gzip_accept_encoding(ngx_str_t *ae);
78e18a033bSKonstantin Ananyevstatic ngx_uint_t ngx_http_gzip_quantity(u_char *p, u_char *last);
79e18a033bSKonstantin Ananyevstatic char *ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd,
80e18a033bSKonstantin Ananyev    void *conf);
81e18a033bSKonstantin Ananyev#endif
82e18a033bSKonstantin Ananyevstatic ngx_int_t ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r,
83e18a033bSKonstantin Ananyev    ngx_addr_t *addr, u_char *xff, size_t xfflen, ngx_array_t *proxies,
84e18a033bSKonstantin Ananyev    int recursive);
85e18a033bSKonstantin Ananyev#if (NGX_HAVE_OPENAT)
86e18a033bSKonstantin Ananyevstatic char *ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd,
87e18a033bSKonstantin Ananyev    void *conf);
88e18a033bSKonstantin Ananyev#endif
89e18a033bSKonstantin Ananyev
90e18a033bSKonstantin Ananyevstatic char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
91e18a033bSKonstantin Ananyevstatic char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
92e18a033bSKonstantin Ananyev
93e18a033bSKonstantin Ananyevstatic ngx_conf_post_t  ngx_http_core_lowat_post =
94e18a033bSKonstantin Ananyev    { ngx_http_core_lowat_check };
95e18a033bSKonstantin Ananyev
96e18a033bSKonstantin Ananyevstatic ngx_conf_post_handler_pt  ngx_http_core_pool_size_p =
97e18a033bSKonstantin Ananyev    ngx_http_core_pool_size;
98e18a033bSKonstantin Ananyev
99e18a033bSKonstantin Ananyev
100e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_core_request_body_in_file[] = {
101e18a033bSKonstantin Ananyev    { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF },
102e18a033bSKonstantin Ananyev    { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON },
103e18a033bSKonstantin Ananyev    { ngx_string("clean"), NGX_HTTP_REQUEST_BODY_FILE_CLEAN },
104e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
105e18a033bSKonstantin Ananyev};
106e18a033bSKonstantin Ananyev
107e18a033bSKonstantin Ananyev
108e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_core_satisfy[] = {
109e18a033bSKonstantin Ananyev    { ngx_string("all"), NGX_HTTP_SATISFY_ALL },
110e18a033bSKonstantin Ananyev    { ngx_string("any"), NGX_HTTP_SATISFY_ANY },
111e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
112e18a033bSKonstantin Ananyev};
113e18a033bSKonstantin Ananyev
114e18a033bSKonstantin Ananyev
115e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_core_lingering_close[] = {
116e18a033bSKonstantin Ananyev    { ngx_string("off"), NGX_HTTP_LINGERING_OFF },
117e18a033bSKonstantin Ananyev    { ngx_string("on"), NGX_HTTP_LINGERING_ON },
118e18a033bSKonstantin Ananyev    { ngx_string("always"), NGX_HTTP_LINGERING_ALWAYS },
119e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
120e18a033bSKonstantin Ananyev};
121e18a033bSKonstantin Ananyev
122e18a033bSKonstantin Ananyev
123e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_core_server_tokens[] = {
124e18a033bSKonstantin Ananyev    { ngx_string("off"), NGX_HTTP_SERVER_TOKENS_OFF },
125e18a033bSKonstantin Ananyev    { ngx_string("on"), NGX_HTTP_SERVER_TOKENS_ON },
126e18a033bSKonstantin Ananyev    { ngx_string("build"), NGX_HTTP_SERVER_TOKENS_BUILD },
127e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
128e18a033bSKonstantin Ananyev};
129e18a033bSKonstantin Ananyev
130e18a033bSKonstantin Ananyev
131e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_core_if_modified_since[] = {
132e18a033bSKonstantin Ananyev    { ngx_string("off"), NGX_HTTP_IMS_OFF },
133e18a033bSKonstantin Ananyev    { ngx_string("exact"), NGX_HTTP_IMS_EXACT },
134e18a033bSKonstantin Ananyev    { ngx_string("before"), NGX_HTTP_IMS_BEFORE },
135e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
136e18a033bSKonstantin Ananyev};
137e18a033bSKonstantin Ananyev
138e18a033bSKonstantin Ananyev
139e18a033bSKonstantin Ananyevstatic ngx_conf_bitmask_t  ngx_http_core_keepalive_disable[] = {
140e18a033bSKonstantin Ananyev    { ngx_string("none"), NGX_HTTP_KEEPALIVE_DISABLE_NONE },
141e18a033bSKonstantin Ananyev    { ngx_string("msie6"), NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 },
142e18a033bSKonstantin Ananyev    { ngx_string("safari"), NGX_HTTP_KEEPALIVE_DISABLE_SAFARI },
143e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
144e18a033bSKonstantin Ananyev};
145e18a033bSKonstantin Ananyev
146e18a033bSKonstantin Ananyev
147e18a033bSKonstantin Ananyevstatic ngx_path_init_t  ngx_http_client_temp_path = {
148e18a033bSKonstantin Ananyev    ngx_string(NGX_HTTP_CLIENT_TEMP_PATH), { 0, 0, 0 }
149e18a033bSKonstantin Ananyev};
150e18a033bSKonstantin Ananyev
151e18a033bSKonstantin Ananyev
152e18a033bSKonstantin Ananyev#if (NGX_HTTP_GZIP)
153e18a033bSKonstantin Ananyev
154e18a033bSKonstantin Ananyevstatic ngx_conf_enum_t  ngx_http_gzip_http_version[] = {
155e18a033bSKonstantin Ananyev    { ngx_string("1.0"), NGX_HTTP_VERSION_10 },
156e18a033bSKonstantin Ananyev    { ngx_string("1.1"), NGX_HTTP_VERSION_11 },
157e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
158e18a033bSKonstantin Ananyev};
159e18a033bSKonstantin Ananyev
160e18a033bSKonstantin Ananyev
161e18a033bSKonstantin Ananyevstatic ngx_conf_bitmask_t  ngx_http_gzip_proxied_mask[] = {
162e18a033bSKonstantin Ananyev    { ngx_string("off"), NGX_HTTP_GZIP_PROXIED_OFF },
163e18a033bSKonstantin Ananyev    { ngx_string("expired"), NGX_HTTP_GZIP_PROXIED_EXPIRED },
164e18a033bSKonstantin Ananyev    { ngx_string("no-cache"), NGX_HTTP_GZIP_PROXIED_NO_CACHE },
165e18a033bSKonstantin Ananyev    { ngx_string("no-store"), NGX_HTTP_GZIP_PROXIED_NO_STORE },
166e18a033bSKonstantin Ananyev    { ngx_string("private"), NGX_HTTP_GZIP_PROXIED_PRIVATE },
167e18a033bSKonstantin Ananyev    { ngx_string("no_last_modified"), NGX_HTTP_GZIP_PROXIED_NO_LM },
168e18a033bSKonstantin Ananyev    { ngx_string("no_etag"), NGX_HTTP_GZIP_PROXIED_NO_ETAG },
169e18a033bSKonstantin Ananyev    { ngx_string("auth"), NGX_HTTP_GZIP_PROXIED_AUTH },
170e18a033bSKonstantin Ananyev    { ngx_string("any"), NGX_HTTP_GZIP_PROXIED_ANY },
171e18a033bSKonstantin Ananyev    { ngx_null_string, 0 }
172e18a033bSKonstantin Ananyev};
173e18a033bSKonstantin Ananyev
174e18a033bSKonstantin Ananyev
175e18a033bSKonstantin Ananyevstatic ngx_str_t  ngx_http_gzip_no_cache = ngx_string("no-cache");
176e18a033bSKonstantin Ananyevstatic ngx_str_t  ngx_http_gzip_no_store = ngx_string("no-store");
177e18a033bSKonstantin Ananyevstatic ngx_str_t  ngx_http_gzip_private = ngx_string("private");
178e18a033bSKonstantin Ananyev
179e18a033bSKonstantin Ananyev#endif
180e18a033bSKonstantin Ananyev
181e18a033bSKonstantin Ananyev
182e18a033bSKonstantin Ananyevstatic ngx_command_t  ngx_http_core_commands[] = {
183e18a033bSKonstantin Ananyev
184e18a033bSKonstantin Ananyev    { ngx_string("variables_hash_max_size"),
185e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
186e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
187e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF_OFFSET,
188e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_main_conf_t, variables_hash_max_size),
189e18a033bSKonstantin Ananyev      NULL },
190e18a033bSKonstantin Ananyev
191e18a033bSKonstantin Ananyev    { ngx_string("variables_hash_bucket_size"),
192e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
193e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
194e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF_OFFSET,
195e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_main_conf_t, variables_hash_bucket_size),
196e18a033bSKonstantin Ananyev      NULL },
197e18a033bSKonstantin Ananyev
198e18a033bSKonstantin Ananyev    { ngx_string("server_names_hash_max_size"),
199e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
200e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
201e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF_OFFSET,
202e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_main_conf_t, server_names_hash_max_size),
203e18a033bSKonstantin Ananyev      NULL },
204e18a033bSKonstantin Ananyev
205e18a033bSKonstantin Ananyev    { ngx_string("server_names_hash_bucket_size"),
206e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
207e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
208e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF_OFFSET,
209e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_main_conf_t, server_names_hash_bucket_size),
210e18a033bSKonstantin Ananyev      NULL },
211e18a033bSKonstantin Ananyev
212e18a033bSKonstantin Ananyev    { ngx_string("server"),
213e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
214e18a033bSKonstantin Ananyev      ngx_http_core_server,
215e18a033bSKonstantin Ananyev      0,
216e18a033bSKonstantin Ananyev      0,
217e18a033bSKonstantin Ananyev      NULL },
218e18a033bSKonstantin Ananyev
219e18a033bSKonstantin Ananyev    { ngx_string("connection_pool_size"),
220e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
221e18a033bSKonstantin Ananyev      ngx_conf_set_size_slot,
222e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
223e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, connection_pool_size),
224e18a033bSKonstantin Ananyev      &ngx_http_core_pool_size_p },
225e18a033bSKonstantin Ananyev
226e18a033bSKonstantin Ananyev    { ngx_string("request_pool_size"),
227e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
228e18a033bSKonstantin Ananyev      ngx_conf_set_size_slot,
229e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
230e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, request_pool_size),
231e18a033bSKonstantin Ananyev      &ngx_http_core_pool_size_p },
232e18a033bSKonstantin Ananyev
233e18a033bSKonstantin Ananyev    { ngx_string("client_header_timeout"),
234e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
235e18a033bSKonstantin Ananyev      ngx_conf_set_msec_slot,
236e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
237e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, client_header_timeout),
238e18a033bSKonstantin Ananyev      NULL },
239e18a033bSKonstantin Ananyev
240e18a033bSKonstantin Ananyev    { ngx_string("client_header_buffer_size"),
241e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
242e18a033bSKonstantin Ananyev      ngx_conf_set_size_slot,
243e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
244e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, client_header_buffer_size),
245e18a033bSKonstantin Ananyev      NULL },
246e18a033bSKonstantin Ananyev
247e18a033bSKonstantin Ananyev    { ngx_string("large_client_header_buffers"),
248e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE2,
249e18a033bSKonstantin Ananyev      ngx_conf_set_bufs_slot,
250e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
251e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, large_client_header_buffers),
252e18a033bSKonstantin Ananyev      NULL },
253e18a033bSKonstantin Ananyev
254e18a033bSKonstantin Ananyev    { ngx_string("ignore_invalid_headers"),
255e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
256e18a033bSKonstantin Ananyev      ngx_conf_set_flag_slot,
257e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
258e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers),
259e18a033bSKonstantin Ananyev      NULL },
260e18a033bSKonstantin Ananyev
261e18a033bSKonstantin Ananyev    { ngx_string("merge_slashes"),
262e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
263e18a033bSKonstantin Ananyev      ngx_conf_set_flag_slot,
264e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
265e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, merge_slashes),
266e18a033bSKonstantin Ananyev      NULL },
267e18a033bSKonstantin Ananyev
268e18a033bSKonstantin Ananyev    { ngx_string("underscores_in_headers"),
269e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
270e18a033bSKonstantin Ananyev      ngx_conf_set_flag_slot,
271e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
272e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_srv_conf_t, underscores_in_headers),
273e18a033bSKonstantin Ananyev      NULL },
274e18a033bSKonstantin Ananyev
275e18a033bSKonstantin Ananyev    { ngx_string("location"),
276e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
277e18a033bSKonstantin Ananyev      ngx_http_core_location,
278e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
279e18a033bSKonstantin Ananyev      0,
280e18a033bSKonstantin Ananyev      NULL },
281e18a033bSKonstantin Ananyev
282e18a033bSKonstantin Ananyev    { ngx_string("listen"),
283e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
284e18a033bSKonstantin Ananyev      ngx_http_core_listen,
285e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
286e18a033bSKonstantin Ananyev      0,
287e18a033bSKonstantin Ananyev      NULL },
288e18a033bSKonstantin Ananyev
289e18a033bSKonstantin Ananyev    { ngx_string("server_name"),
290e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
291e18a033bSKonstantin Ananyev      ngx_http_core_server_name,
292e18a033bSKonstantin Ananyev      NGX_HTTP_SRV_CONF_OFFSET,
293e18a033bSKonstantin Ananyev      0,
294e18a033bSKonstantin Ananyev      NULL },
295e18a033bSKonstantin Ananyev
296e18a033bSKonstantin Ananyev    { ngx_string("types_hash_max_size"),
297e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
298e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
299e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
300e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, types_hash_max_size),
301e18a033bSKonstantin Ananyev      NULL },
302e18a033bSKonstantin Ananyev
303e18a033bSKonstantin Ananyev    { ngx_string("types_hash_bucket_size"),
304e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
305e18a033bSKonstantin Ananyev      ngx_conf_set_num_slot,
306e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
307e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, types_hash_bucket_size),
308e18a033bSKonstantin Ananyev      NULL },
309e18a033bSKonstantin Ananyev
310e18a033bSKonstantin Ananyev    { ngx_string("types"),
311e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
312e18a033bSKonstantin Ananyev                                          |NGX_CONF_BLOCK|NGX_CONF_NOARGS,
313e18a033bSKonstantin Ananyev      ngx_http_core_types,
314e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
315e18a033bSKonstantin Ananyev      0,
316e18a033bSKonstantin Ananyev      NULL },
317e18a033bSKonstantin Ananyev
318e18a033bSKonstantin Ananyev    { ngx_string("default_type"),
319e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
320e18a033bSKonstantin Ananyev      ngx_conf_set_str_slot,
321e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
322e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, default_type),
323e18a033bSKonstantin Ananyev      NULL },
324e18a033bSKonstantin Ananyev
325e18a033bSKonstantin Ananyev    { ngx_string("root"),
326e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
327e18a033bSKonstantin Ananyev                        |NGX_CONF_TAKE1,
328e18a033bSKonstantin Ananyev      ngx_http_core_root,
329e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
330e18a033bSKonstantin Ananyev      0,
331e18a033bSKonstantin Ananyev      NULL },
332e18a033bSKonstantin Ananyev
333e18a033bSKonstantin Ananyev    { ngx_string("alias"),
334e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
335e18a033bSKonstantin Ananyev      ngx_http_core_root,
336e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
337e18a033bSKonstantin Ananyev      0,
338e18a033bSKonstantin Ananyev      NULL },
339e18a033bSKonstantin Ananyev
340e18a033bSKonstantin Ananyev    { ngx_string("limit_except"),
341e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE,
342e18a033bSKonstantin Ananyev      ngx_http_core_limit_except,
343e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
344e18a033bSKonstantin Ananyev      0,
345e18a033bSKonstantin Ananyev      NULL },
346e18a033bSKonstantin Ananyev
347e18a033bSKonstantin Ananyev    { ngx_string("client_max_body_size"),
348e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
349e18a033bSKonstantin Ananyev      ngx_conf_set_off_slot,
350e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
351e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_max_body_size),
352e18a033bSKonstantin Ananyev      NULL },
353e18a033bSKonstantin Ananyev
354e18a033bSKonstantin Ananyev    { ngx_string("client_body_buffer_size"),
355e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
356e18a033bSKonstantin Ananyev      ngx_conf_set_size_slot,
357e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
358e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_body_buffer_size),
359e18a033bSKonstantin Ananyev      NULL },
360e18a033bSKonstantin Ananyev
361e18a033bSKonstantin Ananyev    { ngx_string("client_body_timeout"),
362e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
363e18a033bSKonstantin Ananyev      ngx_conf_set_msec_slot,
364e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
365e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_body_timeout),
366e18a033bSKonstantin Ananyev      NULL },
367e18a033bSKonstantin Ananyev
368e18a033bSKonstantin Ananyev    { ngx_string("client_body_temp_path"),
369e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
370e18a033bSKonstantin Ananyev      ngx_conf_set_path_slot,
371e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
372e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_body_temp_path),
373e18a033bSKonstantin Ananyev      NULL },
374e18a033bSKonstantin Ananyev
375e18a033bSKonstantin Ananyev    { ngx_string("client_body_in_file_only"),
376e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
377e18a033bSKonstantin Ananyev      ngx_conf_set_enum_slot,
378e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
379e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only),
380e18a033bSKonstantin Ananyev      &ngx_http_core_request_body_in_file },
381e18a033bSKonstantin Ananyev
382e18a033bSKonstantin Ananyev    { ngx_string("client_body_in_single_buffer"),
383e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
384e18a033bSKonstantin Ananyev      ngx_conf_set_flag_slot,
385e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
386e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, client_body_in_single_buffer),
387e18a033bSKonstantin Ananyev      NULL },
388e18a033bSKonstantin Ananyev
389e18a033bSKonstantin Ananyev    { ngx_string("sendfile"),
390e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
391e18a033bSKonstantin Ananyev                        |NGX_CONF_FLAG,
392e18a033bSKonstantin Ananyev      ngx_conf_set_flag_slot,
393e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
394e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, sendfile),
395e18a033bSKonstantin Ananyev      NULL },
396e18a033bSKonstantin Ananyev
397e18a033bSKonstantin Ananyev    { ngx_string("sendfile_max_chunk"),
398e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
399e18a033bSKonstantin Ananyev      ngx_conf_set_size_slot,
400e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
401e18a033bSKonstantin Ananyev      offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
402e18a033bSKonstantin Ananyev      NULL },
403e18a033bSKonstantin Ananyev
404e18a033bSKonstantin Ananyev    { ngx_string("aio"),
405e18a033bSKonstantin Ananyev      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
406e18a033bSKonstantin Ananyev      ngx_http_core_set_aio,
407e18a033bSKonstantin Ananyev      NGX_HTTP_LOC_CONF_OFFSET,
408e18a033bSKonstantin Ananyev      0,
409e18a033bSKonstantin Ananyev      NULL },
410e18a033bSKonstantin Ananyev
411e18a033bSKonstantin Ananyev    { ngx_string("aio_write"),
412e18a033bSKonstantin Ananyev