Mercurial > hg > nginx
annotate src/http/ngx_http_core_module.c @ 2541:e73f70b4ca5c
fix case when the first try is shorter then URI
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 01 Mar 2009 19:10:36 +0000 |
parents | a6d6d762c554 |
children | 163114282d2c |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
440
diff
changeset
|
5 |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 |
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #include <ngx_config.h> |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
8 #include <ngx_core.h> |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
9 #include <ngx_http.h> |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
10 |
461 | 11 |
631 | 12 typedef struct { |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
13 u_char *name; |
631 | 14 uint32_t method; |
15 } ngx_http_method_name_t; | |
16 | |
17 | |
1073 | 18 #define NGX_HTTP_REQUEST_BODY_FILE_OFF 0 |
19 #define NGX_HTTP_REQUEST_BODY_FILE_ON 1 | |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1073
diff
changeset
|
20 #define NGX_HTTP_REQUEST_BODY_FILE_CLEAN 2 |
1073 | 21 |
22 | |
2027 | 23 static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r); |
24 static ngx_int_t ngx_http_core_find_static_location(ngx_http_request_t *r, | |
25 ngx_http_location_tree_node_t *node); | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
26 |
509 | 27 static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf); |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
28 static void *ngx_http_core_create_main_conf(ngx_conf_t *cf); |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
29 static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf); |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
30 static void *ngx_http_core_create_srv_conf(ngx_conf_t *cf); |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
31 static char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf, |
487 | 32 void *parent, void *child); |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
33 static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf); |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
34 static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf, |
487 | 35 void *parent, void *child); |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
36 |
485 | 37 static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 38 void *dummy); |
485 | 39 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 40 void *dummy); |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
41 static ngx_int_t ngx_http_core_regex_location(ngx_conf_t *cf, |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
42 ngx_http_core_loc_conf_t *clcf, ngx_str_t *regex, ngx_uint_t caseless); |
485 | 43 |
44 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, | |
487 | 45 void *conf); |
485 | 46 static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, |
487 | 47 void *conf); |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 |
485 | 49 static char *ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 50 void *conf); |
485 | 51 static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 52 void *conf); |
485 | 53 static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
631 | 54 static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, |
55 void *conf); | |
2129 | 56 static char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, |
57 void *conf); | |
485 | 58 static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 59 void *conf); |
2407 | 60 static char *ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, |
61 void *conf); | |
1454 | 62 static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd, |
63 void *conf); | |
485 | 64 static char *ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 65 void *conf); |
485 | 66 static char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, |
487 | 67 void *conf); |
509 | 68 static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, |
69 void *conf); | |
1674 | 70 static char *ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
71 void *conf); |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
72 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
73 static char *ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
74 void *conf); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
75 #endif |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
76 |
485 | 77 static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data); |
1200 | 78 static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data); |
485 | 79 |
80 static ngx_conf_post_t ngx_http_core_lowat_post = | |
1199 | 81 { ngx_http_core_lowat_check }; |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
82 |
1200 | 83 static ngx_conf_post_handler_pt ngx_http_core_pool_size_p = |
84 ngx_http_core_pool_size; | |
85 | |
2029
c036922f6f07
*) remove optimize_host_names
Igor Sysoev <igor@sysoev.ru>
parents:
2027
diff
changeset
|
86 static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_server_names = { |
c036922f6f07
*) remove optimize_host_names
Igor Sysoev <igor@sysoev.ru>
parents:
2027
diff
changeset
|
87 ngx_conf_deprecated, "optimize_server_names", "server_name_in_redirect" |
609 | 88 }; |
89 | |
1767
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
90 static ngx_conf_deprecated_t ngx_conf_deprecated_open_file_cache_retest = { |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
91 ngx_conf_deprecated, "open_file_cache_retest", "open_file_cache_valid" |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
92 }; |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
93 |
1806 | 94 static ngx_conf_deprecated_t ngx_conf_deprecated_satisfy_any = { |
95 ngx_conf_deprecated, "satisfy_any", "satisfy" | |
96 }; | |
97 | |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
98 |
1073 | 99 static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = { |
100 { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF }, | |
101 { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON }, | |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1073
diff
changeset
|
102 { ngx_string("clean"), NGX_HTTP_REQUEST_BODY_FILE_CLEAN }, |
1073 | 103 { ngx_null_string, 0 } |
104 }; | |
105 | |
106 | |
1806 | 107 static ngx_conf_enum_t ngx_http_core_satisfy[] = { |
108 { ngx_string("all"), NGX_HTTP_SATISFY_ALL }, | |
109 { ngx_string("any"), NGX_HTTP_SATISFY_ANY }, | |
110 { ngx_null_string, 0 } | |
111 }; | |
112 | |
113 | |
2361 | 114 static ngx_conf_enum_t ngx_http_core_if_modified_since[] = { |
2496 | 115 { ngx_string("off"), NGX_HTTP_IMS_OFF }, |
116 { ngx_string("exact"), NGX_HTTP_IMS_EXACT }, | |
117 { ngx_string("before"), NGX_HTTP_IMS_BEFORE }, | |
2361 | 118 { ngx_null_string, 0 } |
119 }; | |
120 | |
121 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
122 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
123 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
124 static ngx_conf_enum_t ngx_http_gzip_http_version[] = { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
125 { ngx_string("1.0"), NGX_HTTP_VERSION_10 }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
126 { ngx_string("1.1"), NGX_HTTP_VERSION_11 }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
127 { ngx_null_string, 0 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
128 }; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
129 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
130 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
131 static ngx_conf_bitmask_t ngx_http_gzip_proxied_mask[] = { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
132 { ngx_string("off"), NGX_HTTP_GZIP_PROXIED_OFF }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
133 { ngx_string("expired"), NGX_HTTP_GZIP_PROXIED_EXPIRED }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
134 { ngx_string("no-cache"), NGX_HTTP_GZIP_PROXIED_NO_CACHE }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
135 { ngx_string("no-store"), NGX_HTTP_GZIP_PROXIED_NO_STORE }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
136 { ngx_string("private"), NGX_HTTP_GZIP_PROXIED_PRIVATE }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
137 { ngx_string("no_last_modified"), NGX_HTTP_GZIP_PROXIED_NO_LM }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
138 { ngx_string("no_etag"), NGX_HTTP_GZIP_PROXIED_NO_ETAG }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
139 { ngx_string("auth"), NGX_HTTP_GZIP_PROXIED_AUTH }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
140 { ngx_string("any"), NGX_HTTP_GZIP_PROXIED_ANY }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
141 { ngx_null_string, 0 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
142 }; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
143 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
144 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
145 static ngx_str_t ngx_http_gzip_no_cache = ngx_string("no-cache"); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
146 static ngx_str_t ngx_http_gzip_no_store = ngx_string("no-store"); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
147 static ngx_str_t ngx_http_gzip_private = ngx_string("private"); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
148 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
149 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
150 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
151 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
152 static ngx_command_t ngx_http_core_commands[] = { |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
153 |
611 | 154 { ngx_string("variables_hash_max_size"), |
155 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | |
156 ngx_conf_set_num_slot, | |
157 NGX_HTTP_MAIN_CONF_OFFSET, | |
158 offsetof(ngx_http_core_main_conf_t, variables_hash_max_size), | |
159 NULL }, | |
160 | |
161 { ngx_string("variables_hash_bucket_size"), | |
162 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, | |
163 ngx_conf_set_num_slot, | |
164 NGX_HTTP_MAIN_CONF_OFFSET, | |
165 offsetof(ngx_http_core_main_conf_t, variables_hash_bucket_size), | |
166 NULL }, | |
167 | |
593 | 168 { ngx_string("server_names_hash_max_size"), |
477 | 169 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, |
170 ngx_conf_set_num_slot, | |
171 NGX_HTTP_MAIN_CONF_OFFSET, | |
593 | 172 offsetof(ngx_http_core_main_conf_t, server_names_hash_max_size), |
477 | 173 NULL }, |
174 | |
593 | 175 { ngx_string("server_names_hash_bucket_size"), |
477 | 176 NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, |
177 ngx_conf_set_num_slot, | |
178 NGX_HTTP_MAIN_CONF_OFFSET, | |
593 | 179 offsetof(ngx_http_core_main_conf_t, server_names_hash_bucket_size), |
477 | 180 NULL }, |
181 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
182 { ngx_string("server"), |
651 | 183 NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_MULTI|NGX_CONF_NOARGS, |
485 | 184 ngx_http_core_server, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
185 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
186 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
187 NULL }, |
41
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
188 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
189 { ngx_string("connection_pool_size"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
190 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
191 ngx_conf_set_size_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
192 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
193 offsetof(ngx_http_core_srv_conf_t, connection_pool_size), |
1200 | 194 &ngx_http_core_pool_size_p }, |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
60
diff
changeset
|
195 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
196 { ngx_string("request_pool_size"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
197 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
198 ngx_conf_set_size_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
199 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
200 offsetof(ngx_http_core_srv_conf_t, request_pool_size), |
1200 | 201 &ngx_http_core_pool_size_p }, |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
202 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
203 { ngx_string("client_header_timeout"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
204 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
205 ngx_conf_set_msec_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
206 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
207 offsetof(ngx_http_core_srv_conf_t, client_header_timeout), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
208 NULL }, |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
60
diff
changeset
|
209 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
210 { ngx_string("client_header_buffer_size"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
211 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
212 ngx_conf_set_size_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
213 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
214 offsetof(ngx_http_core_srv_conf_t, client_header_buffer_size), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
215 NULL }, |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
60
diff
changeset
|
216 |
436
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
217 { ngx_string("large_client_header_buffers"), |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
434
diff
changeset
|
218 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE2, |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
434
diff
changeset
|
219 ngx_conf_set_bufs_slot, |
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
434
diff
changeset
|
220 NGX_HTTP_SRV_CONF_OFFSET, |
436
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
221 offsetof(ngx_http_core_srv_conf_t, large_client_header_buffers), |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
222 NULL }, |
64
34d647deb1da
nginx-0.0.1-2003-03-04-09:33:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
60
diff
changeset
|
223 |
609 | 224 { ngx_string("optimize_server_names"), |
225 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, | |
226 ngx_conf_set_flag_slot, | |
2029
c036922f6f07
*) remove optimize_host_names
Igor Sysoev <igor@sysoev.ru>
parents:
2027
diff
changeset
|
227 NGX_HTTP_LOC_CONF_OFFSET, |
c036922f6f07
*) remove optimize_host_names
Igor Sysoev <igor@sysoev.ru>
parents:
2027
diff
changeset
|
228 offsetof(ngx_http_core_loc_conf_t, server_name_in_redirect), |
c036922f6f07
*) remove optimize_host_names
Igor Sysoev <igor@sysoev.ru>
parents:
2027
diff
changeset
|
229 &ngx_conf_deprecated_optimize_server_names }, |
603 | 230 |
511 | 231 { ngx_string("ignore_invalid_headers"), |
232 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, | |
233 ngx_conf_set_flag_slot, | |
234 NGX_HTTP_SRV_CONF_OFFSET, | |
235 offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers), | |
236 NULL }, | |
237 | |
1585 | 238 { ngx_string("merge_slashes"), |
239 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, | |
240 ngx_conf_set_flag_slot, | |
241 NGX_HTTP_SRV_CONF_OFFSET, | |
242 offsetof(ngx_http_core_srv_conf_t, merge_slashes), | |
243 NULL }, | |
244 | |
2256 | 245 { ngx_string("underscores_in_headers"), |
246 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG, | |
247 ngx_conf_set_flag_slot, | |
248 NGX_HTTP_SRV_CONF_OFFSET, | |
249 offsetof(ngx_http_core_srv_conf_t, underscores_in_headers), | |
250 NULL }, | |
251 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
252 { ngx_string("location"), |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
253 NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12, |
485 | 254 ngx_http_core_location, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
255 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
256 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
257 NULL }, |
41
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
258 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
259 { ngx_string("listen"), |
523 | 260 NGX_HTTP_SRV_CONF|NGX_CONF_1MORE, |
485 | 261 ngx_http_core_listen, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
262 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
263 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
264 NULL }, |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
265 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
266 { ngx_string("server_name"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
267 NGX_HTTP_SRV_CONF|NGX_CONF_1MORE, |
485 | 268 ngx_http_core_server_name, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
269 NGX_HTTP_SRV_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
270 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
271 NULL }, |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
272 |
589 | 273 { ngx_string("types_hash_max_size"), |
274 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
275 ngx_conf_set_num_slot, | |
276 NGX_HTTP_LOC_CONF_OFFSET, | |
277 offsetof(ngx_http_core_loc_conf_t, types_hash_max_size), | |
278 NULL }, | |
279 | |
280 { ngx_string("types_hash_bucket_size"), | |
281 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
282 ngx_conf_set_num_slot, | |
283 NGX_HTTP_LOC_CONF_OFFSET, | |
284 offsetof(ngx_http_core_loc_conf_t, types_hash_bucket_size), | |
285 NULL }, | |
286 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
287 { ngx_string("types"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
288 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
289 |NGX_CONF_BLOCK|NGX_CONF_NOARGS, |
485 | 290 ngx_http_core_types, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
291 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
292 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
293 NULL }, |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
294 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
295 { ngx_string("default_type"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
296 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
297 ngx_conf_set_str_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
298 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
299 offsetof(ngx_http_core_loc_conf_t, default_type), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
300 NULL }, |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
301 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
302 { ngx_string("root"), |
509 | 303 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
304 |NGX_CONF_TAKE1, | |
485 | 305 ngx_http_core_root, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
306 NGX_HTTP_LOC_CONF_OFFSET, |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
307 0, |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
308 NULL }, |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
309 |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
310 { ngx_string("alias"), |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
311 NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
485 | 312 ngx_http_core_root, |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
313 NGX_HTTP_LOC_CONF_OFFSET, |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
314 0, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
315 NULL }, |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
316 |
631 | 317 { ngx_string("limit_except"), |
318 NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE, | |
319 ngx_http_core_limit_except, | |
320 NGX_HTTP_LOC_CONF_OFFSET, | |
321 0, | |
322 NULL }, | |
323 | |
293
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
324 { ngx_string("client_max_body_size"), |
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
325 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
663 | 326 ngx_conf_set_off_slot, |
293
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
327 NGX_HTTP_LOC_CONF_OFFSET, |
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
328 offsetof(ngx_http_core_loc_conf_t, client_max_body_size), |
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
329 NULL }, |
ec3c049681fd
nginx-0.0.3-2004-03-19-08:25:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
330 |
303
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
331 { ngx_string("client_body_buffer_size"), |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
332 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
333 ngx_conf_set_size_slot, |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
334 NGX_HTTP_LOC_CONF_OFFSET, |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
335 offsetof(ngx_http_core_loc_conf_t, client_body_buffer_size), |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
336 NULL }, |
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
337 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
338 { ngx_string("client_body_timeout"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
339 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
340 ngx_conf_set_msec_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
341 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
342 offsetof(ngx_http_core_loc_conf_t, client_body_timeout), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
343 NULL }, |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
160
diff
changeset
|
344 |
479 | 345 { ngx_string("client_body_temp_path"), |
346 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234, | |
347 ngx_conf_set_path_slot, | |
348 NGX_HTTP_LOC_CONF_OFFSET, | |
349 offsetof(ngx_http_core_loc_conf_t, client_body_temp_path), | |
350 (void *) ngx_garbage_collector_temp_handler }, | |
351 | |
633 | 352 { ngx_string("client_body_in_file_only"), |
353 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
1073 | 354 ngx_conf_set_enum_slot, |
633 | 355 NGX_HTTP_LOC_CONF_OFFSET, |
356 offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only), | |
1073 | 357 &ngx_http_core_request_body_in_file }, |
633 | 358 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
359 { ngx_string("sendfile"), |
1070
b54a1e283d6d
allow "sendfile" in "if" context
Igor Sysoev <igor@sysoev.ru>
parents:
1028
diff
changeset
|
360 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
b54a1e283d6d
allow "sendfile" in "if" context
Igor Sysoev <igor@sysoev.ru>
parents:
1028
diff
changeset
|
361 |NGX_CONF_TAKE1, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
362 ngx_conf_set_flag_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
363 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
364 offsetof(ngx_http_core_loc_conf_t, sendfile), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
365 NULL }, |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
366 |
1197 | 367 { ngx_string("sendfile_max_chunk"), |
368 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
369 ngx_conf_set_size_slot, | |
370 NGX_HTTP_LOC_CONF_OFFSET, | |
371 offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk), | |
372 NULL }, | |
373 | |
2129 | 374 { ngx_string("directio"), |
375 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
376 ngx_http_core_directio, | |
377 NGX_HTTP_LOC_CONF_OFFSET, | |
378 0, | |
379 NULL }, | |
380 | |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
381 { ngx_string("tcp_nopush"), |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
382 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
383 ngx_conf_set_flag_slot, |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
384 NGX_HTTP_LOC_CONF_OFFSET, |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
385 offsetof(ngx_http_core_loc_conf_t, tcp_nopush), |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
386 NULL }, |
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
387 |
452 | 388 { ngx_string("tcp_nodelay"), |
389 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
390 ngx_conf_set_flag_slot, | |
391 NGX_HTTP_LOC_CONF_OFFSET, | |
392 offsetof(ngx_http_core_loc_conf_t, tcp_nodelay), | |
393 NULL }, | |
394 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
395 { ngx_string("send_timeout"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
396 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
397 ngx_conf_set_msec_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
398 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
399 offsetof(ngx_http_core_loc_conf_t, send_timeout), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
400 NULL }, |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
401 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
402 { ngx_string("send_lowat"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
403 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
404 ngx_conf_set_size_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
405 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
406 offsetof(ngx_http_core_loc_conf_t, send_lowat), |
485 | 407 &ngx_http_core_lowat_post }, |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
408 |
391
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
409 { ngx_string("postpone_output"), |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
410 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
411 ngx_conf_set_size_slot, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
412 NGX_HTTP_LOC_CONF_OFFSET, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
413 offsetof(ngx_http_core_loc_conf_t, postpone_output), |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
414 NULL }, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
415 |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
416 { ngx_string("limit_rate"), |
485 | 417 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
418 |NGX_CONF_TAKE1, | |
391
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
419 ngx_conf_set_size_slot, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
420 NGX_HTTP_LOC_CONF_OFFSET, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
421 offsetof(ngx_http_core_loc_conf_t, limit_rate), |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
422 NULL }, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
423 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
424 { ngx_string("keepalive_timeout"), |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
425 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, |
485 | 426 ngx_http_core_keepalive, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
427 NGX_HTTP_LOC_CONF_OFFSET, |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
428 0, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
429 NULL }, |
93
738fe44c70d5
nginx-0.0.1-2003-05-21-17:28:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
430 |
1806 | 431 { ngx_string("satisfy"), |
432 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
433 ngx_conf_set_enum_slot, | |
434 NGX_HTTP_LOC_CONF_OFFSET, | |
435 offsetof(ngx_http_core_loc_conf_t, satisfy), | |
436 &ngx_http_core_satisfy }, | |
437 | |
543 | 438 { ngx_string("satisfy_any"), |
439 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
440 ngx_conf_set_flag_slot, | |
441 NGX_HTTP_LOC_CONF_OFFSET, | |
1806 | 442 offsetof(ngx_http_core_loc_conf_t, satisfy), |
443 &ngx_conf_deprecated_satisfy_any }, | |
543 | 444 |
509 | 445 { ngx_string("internal"), |
446 NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS, | |
447 ngx_http_core_internal, | |
448 NGX_HTTP_LOC_CONF_OFFSET, | |
449 0, | |
450 NULL }, | |
451 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
452 { ngx_string("lingering_time"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
453 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
454 ngx_conf_set_msec_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
455 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
456 offsetof(ngx_http_core_loc_conf_t, lingering_time), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
457 NULL }, |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
64
diff
changeset
|
458 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
459 { ngx_string("lingering_timeout"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
460 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
461 ngx_conf_set_msec_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
462 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
463 offsetof(ngx_http_core_loc_conf_t, lingering_timeout), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
464 NULL }, |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
64
diff
changeset
|
465 |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
466 { ngx_string("reset_timedout_connection"), |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
467 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
468 ngx_conf_set_flag_slot, |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
469 NGX_HTTP_LOC_CONF_OFFSET, |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
470 offsetof(ngx_http_core_loc_conf_t, reset_timedout_connection), |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
471 NULL }, |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
472 |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
473 { ngx_string("server_name_in_redirect"), |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
474 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
475 ngx_conf_set_flag_slot, |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
476 NGX_HTTP_LOC_CONF_OFFSET, |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
477 offsetof(ngx_http_core_loc_conf_t, server_name_in_redirect), |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
478 NULL }, |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
479 |
521 | 480 { ngx_string("port_in_redirect"), |
481 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
482 ngx_conf_set_flag_slot, | |
483 NGX_HTTP_LOC_CONF_OFFSET, | |
484 offsetof(ngx_http_core_loc_conf_t, port_in_redirect), | |
485 NULL }, | |
486 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
487 { ngx_string("msie_padding"), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
488 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
489 ngx_conf_set_flag_slot, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
490 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
491 offsetof(ngx_http_core_loc_conf_t, msie_padding), |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
492 NULL }, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
493 |
679 | 494 { ngx_string("msie_refresh"), |
495 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
496 ngx_conf_set_flag_slot, | |
497 NGX_HTTP_LOC_CONF_OFFSET, | |
498 offsetof(ngx_http_core_loc_conf_t, msie_refresh), | |
499 NULL }, | |
500 | |
527 | 501 { ngx_string("log_not_found"), |
502 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
503 ngx_conf_set_flag_slot, | |
504 NGX_HTTP_LOC_CONF_OFFSET, | |
505 offsetof(ngx_http_core_loc_conf_t, log_not_found), | |
506 NULL }, | |
507 | |
2261 | 508 { ngx_string("log_subrequest"), |
509 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
510 ngx_conf_set_flag_slot, | |
511 NGX_HTTP_LOC_CONF_OFFSET, | |
512 offsetof(ngx_http_core_loc_conf_t, log_subrequest), | |
513 NULL }, | |
514 | |
679 | 515 { ngx_string("recursive_error_pages"), |
516 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
517 ngx_conf_set_flag_slot, | |
518 NGX_HTTP_LOC_CONF_OFFSET, | |
519 offsetof(ngx_http_core_loc_conf_t, recursive_error_pages), | |
520 NULL }, | |
521 | |
1592 | 522 { ngx_string("server_tokens"), |
523 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
524 ngx_conf_set_flag_slot, | |
525 NGX_HTTP_LOC_CONF_OFFSET, | |
526 offsetof(ngx_http_core_loc_conf_t, server_tokens), | |
527 NULL }, | |
528 | |
2361 | 529 { ngx_string("if_modified_since"), |
530 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
531 ngx_conf_set_enum_slot, | |
532 NGX_HTTP_LOC_CONF_OFFSET, | |
533 offsetof(ngx_http_core_loc_conf_t, if_modified_since), | |
534 &ngx_http_core_if_modified_since }, | |
535 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
536 { ngx_string("error_page"), |
509 | 537 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
538 |NGX_CONF_2MORE, | |
485 | 539 ngx_http_core_error_page, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
540 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
541 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
542 NULL }, |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
543 |
2407 | 544 { ngx_string("try_files"), |
545 NGX_HTTP_LOC_CONF|NGX_CONF_2MORE, | |
546 ngx_http_core_try_files, | |
547 NGX_HTTP_LOC_CONF_OFFSET, | |
548 0, | |
549 NULL }, | |
550 | |
577 | 551 { ngx_string("post_action"), |
552 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF | |
553 |NGX_CONF_TAKE1, | |
554 ngx_conf_set_str_slot, | |
555 NGX_HTTP_LOC_CONF_OFFSET, | |
556 offsetof(ngx_http_core_loc_conf_t, post_action), | |
557 NULL }, | |
558 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
559 { ngx_string("error_log"), |
234
cd71b95716b4
nginx-0.0.1-2004-01-20-23:40:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
218
diff
changeset
|
560 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
485 | 561 ngx_http_core_error_log, |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
562 NGX_HTTP_LOC_CONF_OFFSET, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
563 0, |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
564 NULL }, |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
565 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
566 { ngx_string("open_file_cache"), |
1454 | 567 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, |
568 ngx_http_core_open_file_cache, | |
569 NGX_HTTP_LOC_CONF_OFFSET, | |
570 offsetof(ngx_http_core_loc_conf_t, open_file_cache), | |
571 NULL }, | |
572 | |
1767
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
573 { ngx_string("open_file_cache_valid"), |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
574 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
575 ngx_conf_set_sec_slot, |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
576 NGX_HTTP_LOC_CONF_OFFSET, |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
577 offsetof(ngx_http_core_loc_conf_t, open_file_cache_valid), |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
578 NULL }, |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
579 |
1454 | 580 { ngx_string("open_file_cache_retest"), |
581 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
582 ngx_conf_set_sec_slot, | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
583 NGX_HTTP_LOC_CONF_OFFSET, |
1767
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
584 offsetof(ngx_http_core_loc_conf_t, open_file_cache_valid), |
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
585 &ngx_conf_deprecated_open_file_cache_retest }, |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
586 |
1772 | 587 { ngx_string("open_file_cache_min_uses"), |
588 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
589 ngx_conf_set_num_slot, | |
590 NGX_HTTP_LOC_CONF_OFFSET, | |
591 offsetof(ngx_http_core_loc_conf_t, open_file_cache_min_uses), | |
592 NULL }, | |
593 | |
1454 | 594 { ngx_string("open_file_cache_errors"), |
595 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
596 ngx_conf_set_flag_slot, | |
597 NGX_HTTP_LOC_CONF_OFFSET, | |
598 offsetof(ngx_http_core_loc_conf_t, open_file_cache_errors), | |
599 NULL }, | |
287
35a6a9df2d25
nginx-0.0.2-2004-03-12-19:57:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
600 |
1457 | 601 { ngx_string("open_file_cache_events"), |
602 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
603 ngx_conf_set_flag_slot, | |
604 NGX_HTTP_LOC_CONF_OFFSET, | |
605 offsetof(ngx_http_core_loc_conf_t, open_file_cache_events), | |
606 NULL }, | |
607 | |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
608 { ngx_string("resolver"), |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
609 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
610 ngx_http_core_resolver, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
611 NGX_HTTP_LOC_CONF_OFFSET, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
612 0, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
613 NULL }, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
614 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
615 { ngx_string("resolver_timeout"), |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
616 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
617 ngx_conf_set_msec_slot, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
618 NGX_HTTP_LOC_CONF_OFFSET, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
619 offsetof(ngx_http_core_loc_conf_t, resolver_timeout), |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
620 NULL }, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
621 |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
622 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
623 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
624 { ngx_string("gzip_vary"), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
625 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
626 ngx_conf_set_flag_slot, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
627 NGX_HTTP_LOC_CONF_OFFSET, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
628 offsetof(ngx_http_core_loc_conf_t, gzip_vary), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
629 NULL }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
630 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
631 { ngx_string("gzip_http_version"), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
632 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
633 ngx_conf_set_enum_slot, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
634 NGX_HTTP_LOC_CONF_OFFSET, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
635 offsetof(ngx_http_core_loc_conf_t, gzip_http_version), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
636 &ngx_http_gzip_http_version }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
637 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
638 { ngx_string("gzip_proxied"), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
639 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
640 ngx_conf_set_bitmask_slot, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
641 NGX_HTTP_LOC_CONF_OFFSET, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
642 offsetof(ngx_http_core_loc_conf_t, gzip_proxied), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
643 &ngx_http_gzip_proxied_mask }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
644 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
645 { ngx_string("gzip_disable"), |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
646 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
647 ngx_http_gzip_disable, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
648 NGX_HTTP_LOC_CONF_OFFSET, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
649 0, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
650 NULL }, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
651 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
652 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
653 |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
654 ngx_null_command |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
655 }; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
656 |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
657 |
667 | 658 static ngx_http_module_t ngx_http_core_module_ctx = { |
509 | 659 ngx_http_core_preconfiguration, /* preconfiguration */ |
573 | 660 NULL, /* postconfiguration */ |
177
4db54fdbcbe7
nginx-0.0.1-2003-11-10-20:17:31 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
661 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
662 ngx_http_core_create_main_conf, /* create main configuration */ |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
663 ngx_http_core_init_main_conf, /* init main configuration */ |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
664 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
665 ngx_http_core_create_srv_conf, /* create server configuration */ |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
666 ngx_http_core_merge_srv_conf, /* merge server configuration */ |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
667 |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
668 ngx_http_core_create_loc_conf, /* create location configuration */ |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
669 ngx_http_core_merge_loc_conf /* merge location configuration */ |
41
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
670 }; |
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
671 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
672 |
41
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
673 ngx_module_t ngx_http_core_module = { |
509 | 674 NGX_MODULE_V1, |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
675 &ngx_http_core_module_ctx, /* module context */ |
41
59e7c7f30d49
nginx-0.0.1-2002-12-26-19:26:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
39
diff
changeset
|
676 ngx_http_core_commands, /* module directives */ |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
677 NGX_HTTP_MODULE, /* module type */ |
541 | 678 NULL, /* init master */ |
509 | 679 NULL, /* init module */ |
541 | 680 NULL, /* init process */ |
681 NULL, /* init thread */ | |
682 NULL, /* exit thread */ | |
683 NULL, /* exit process */ | |
684 NULL, /* exit master */ | |
685 NGX_MODULE_V1_PADDING | |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
686 }; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
687 |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
688 |
1882 | 689 static ngx_str_t ngx_http_core_get_method = { 3, (u_char *) "GET " }; |
690 | |
691 | |
487 | 692 void |
693 ngx_http_handler(ngx_http_request_t *r) | |
89
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
694 { |
681 | 695 ngx_http_core_main_conf_t *cmcf; |
696 | |
483 | 697 r->connection->log->action = NULL; |
89
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
698 |
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
699 r->connection->unexpected_eof = 0; |
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
700 |
675 | 701 if (!r->internal) { |
543 | 702 switch (r->headers_in.connection_type) { |
703 case 0: | |
704 if (r->http_version > NGX_HTTP_VERSION_10) { | |
705 r->keepalive = 1; | |
706 } else { | |
707 r->keepalive = 0; | |
708 } | |
709 break; | |
710 | |
711 case NGX_HTTP_CONNECTION_CLOSE: | |
712 r->keepalive = 0; | |
713 break; | |
714 | |
715 case NGX_HTTP_CONNECTION_KEEP_ALIVE: | |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
716 r->keepalive = 1; |
543 | 717 break; |
718 } | |
719 | |
720 if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) { | |
721 | |
722 /* | |
681 | 723 * MSIE may wait for some time if an response for |
724 * a POST request was sent over a keepalive connection | |
543 | 725 */ |
726 | |
152
fb48bf4fea1c
nginx-0.0.1-2003-10-21-11:47:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
727 r->keepalive = 0; |
fb48bf4fea1c
nginx-0.0.1-2003-10-21-11:47:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
728 } |
543 | 729 |
730 if (r->headers_in.content_length_n > 0) { | |
731 r->lingering_close = 1; | |
732 | |
733 } else { | |
734 r->lingering_close = 0; | |
735 } | |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
736 |
681 | 737 r->phase_handler = 0; |
738 | |
739 } else { | |
740 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); | |
741 r->phase_handler = cmcf->phase_engine.server_rewrite_index; | |
742 } | |
743 | |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
744 if (r->unparsed_uri.len) { |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
745 r->valid_unparsed_uri = 1; |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
746 } |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
747 |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
748 r->valid_location = 1; |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
749 r->gzip = 0; |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
715
diff
changeset
|
750 |
681 | 751 r->write_event_handler = ngx_http_core_run_phases; |
485 | 752 ngx_http_core_run_phases(r); |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
753 } |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
754 |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
755 |
681 | 756 void |
487 | 757 ngx_http_core_run_phases(ngx_http_request_t *r) |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
758 { |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
759 ngx_int_t rc; |
681 | 760 ngx_http_phase_handler_t *ph; |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
761 ngx_http_core_main_conf_t *cmcf; |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
762 |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
763 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
764 |
681 | 765 ph = cmcf->phase_engine.handlers; |
766 | |
767 while (ph[r->phase_handler].checker) { | |
768 | |
769 rc = ph[r->phase_handler].checker(r, &ph[r->phase_handler]); | |
770 | |
771 if (rc == NGX_OK) { | |
543 | 772 return; |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
773 } |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
774 } |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
775 } |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
776 |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
777 |
487 | 778 ngx_int_t |
681 | 779 ngx_http_core_generic_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph) |
780 { | |
781 ngx_int_t rc; | |
782 | |
783 /* | |
784 * generic phase checker, | |
785 * used by the post read, server rewrite, rewrite, and pre-access phases | |
786 */ | |
787 | |
788 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
789 "generic phase: %ui", r->phase_handler); | |
790 | |
791 rc = ph->handler(r); | |
792 | |
793 if (rc == NGX_OK) { | |
794 r->phase_handler = ph->next; | |
795 return NGX_AGAIN; | |
796 } | |
797 | |
798 if (rc == NGX_DECLINED) { | |
799 r->phase_handler++; | |
800 return NGX_AGAIN; | |
801 } | |
802 | |
803 if (rc == NGX_AGAIN || rc == NGX_DONE) { | |
804 return NGX_OK; | |
805 } | |
806 | |
807 /* rc == NGX_ERROR || rc == NGX_HTTP_... */ | |
808 | |
809 ngx_http_finalize_request(r, rc); | |
810 | |
811 return NGX_OK; | |
812 } | |
813 | |
814 | |
815 ngx_int_t | |
816 ngx_http_core_find_config_phase(ngx_http_request_t *r, | |
817 ngx_http_phase_handler_t *ph) | |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
119
diff
changeset
|
818 { |
1403 | 819 u_char *p; |
820 size_t len; | |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2435
diff
changeset
|
821 ngx_int_t rc; |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
822 ngx_http_core_loc_conf_t *clcf; |
71
59229033ae93
nginx-0.0.1-2003-04-08-19:40:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
69
diff
changeset
|
823 |
489 | 824 r->content_handler = NULL; |
825 r->uri_changed = 0; | |
826 | |
2027 | 827 rc = ngx_http_core_find_location(r); |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
828 |
2186
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
829 if (rc == NGX_ERROR) { |
681 | 830 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
831 return NGX_OK; | |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
832 } |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
833 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
834 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
835 |
509 | 836 if (!r->internal && clcf->internal) { |
681 | 837 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); |
838 return NGX_OK; | |
509 | 839 } |
840 | |
555 | 841 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
842 "using configuration \"%s%V\"", | |
843 (clcf->noname ? "*" : (clcf->exact_match ? "=" : "")), | |
844 &clcf->name); | |
845 | |
535 | 846 ngx_http_update_location_config(r); |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
847 |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
848 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
663 | 849 "http cl:%O max:%O", |
461 | 850 r->headers_in.content_length_n, clcf->client_max_body_size); |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
851 |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
852 if (r->headers_in.content_length_n != -1 |
673 | 853 && !r->discard_body |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
854 && clcf->client_max_body_size |
663 | 855 && clcf->client_max_body_size < r->headers_in.content_length_n) |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
856 { |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
857 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
1586 | 858 "client intended to send too large body: %O bytes", |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
859 r->headers_in.content_length_n); |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
860 |
681 | 861 ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE); |
862 return NGX_OK; | |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
863 } |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
864 |
2027 | 865 if (rc == NGX_DONE) { |
416
b9bd635011de
nginx-0.0.10-2004-09-06-22:45:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
415
diff
changeset
|
866 r->headers_out.location = ngx_list_push(&r->headers_out.headers); |
b9bd635011de
nginx-0.0.10-2004-09-06-22:45:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
415
diff
changeset
|
867 if (r->headers_out.location == NULL) { |
681 | 868 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
869 return NGX_OK; | |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
870 } |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
871 |
509 | 872 /* |
873 * we do not need to set the r->headers_out.location->hash and | |
874 * r->headers_out.location->key fields | |
875 */ | |
876 | |
1403 | 877 if (r->args.len == 0) { |
878 r->headers_out.location->value = clcf->name; | |
879 | |
880 } else { | |
881 len = clcf->name.len + 1 + r->args.len; | |
2049 | 882 p = ngx_pnalloc(r->pool, len); |
1403 | 883 |
884 if (p == NULL) { | |
885 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
886 return NGX_OK; | |
887 } | |
888 | |
889 r->headers_out.location->value.len = len; | |
890 r->headers_out.location->value.data = p; | |
891 | |
892 p = ngx_cpymem(p, clcf->name.data, clcf->name.len); | |
893 *p++ = '?'; | |
894 ngx_memcpy(p, r->args.data, r->args.len); | |
895 } | |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
896 |
681 | 897 ngx_http_finalize_request(r, NGX_HTTP_MOVED_PERMANENTLY); |
898 return NGX_OK; | |
899 } | |
900 | |
901 r->phase_handler++; | |
902 return NGX_AGAIN; | |
903 } | |
904 | |
905 | |
906 ngx_int_t | |
907 ngx_http_core_post_rewrite_phase(ngx_http_request_t *r, | |
908 ngx_http_phase_handler_t *ph) | |
909 { | |
2043
1d86674d1286
after URI was rewritten location configuration should be to a server's null one
Igor Sysoev <igor@sysoev.ru>
parents:
2029
diff
changeset
|
910 ngx_http_core_srv_conf_t *cscf; |
1d86674d1286
after URI was rewritten location configuration should be to a server's null one
Igor Sysoev <igor@sysoev.ru>
parents:
2029
diff
changeset
|
911 |
681 | 912 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
913 "post rewrite phase: %ui", r->phase_handler); | |
914 | |
915 if (!r->uri_changed) { | |
916 r->phase_handler++; | |
917 return NGX_AGAIN; | |
918 } | |
919 | |
920 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
921 "uri changes: %d", r->uri_changes); | |
922 | |
923 /* | |
924 * gcc before 3.3 compiles the broken code for | |
925 * if (r->uri_changes-- == 0) | |
926 * if the r->uri_changes is defined as | |
927 * unsigned uri_changes:4 | |
928 */ | |
929 | |
930 r->uri_changes--; | |
931 | |
932 if (r->uri_changes == 0) { | |
933 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
934 "rewrite or internal redirection cycle " | |
935 "while processing \"%V\"", &r->uri); | |
936 | |
937 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
938 return NGX_OK; | |
939 } | |
940 | |
941 r->phase_handler = ph->next; | |
942 | |
2043
1d86674d1286
after URI was rewritten location configuration should be to a server's null one
Igor Sysoev <igor@sysoev.ru>
parents:
2029
diff
changeset
|
943 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |
1d86674d1286
after URI was rewritten location configuration should be to a server's null one
Igor Sysoev <igor@sysoev.ru>
parents:
2029
diff
changeset
|
944 r->loc_conf = cscf->ctx->loc_conf; |
1d86674d1286
after URI was rewritten location configuration should be to a server's null one
Igor Sysoev <igor@sysoev.ru>
parents:
2029
diff
changeset
|
945 |
681 | 946 return NGX_AGAIN; |
947 } | |
948 | |
949 | |
950 ngx_int_t | |
951 ngx_http_core_access_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph) | |
952 { | |
953 ngx_int_t rc; | |
954 ngx_http_core_loc_conf_t *clcf; | |
955 | |
956 if (r != r->main) { | |
957 r->phase_handler = ph->next; | |
958 return NGX_AGAIN; | |
959 } | |
960 | |
961 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
962 "access phase: %ui", r->phase_handler); | |
963 | |
964 rc = ph->handler(r); | |
965 | |
966 if (rc == NGX_DECLINED) { | |
967 r->phase_handler++; | |
968 return NGX_AGAIN; | |
969 } | |
970 | |
971 if (rc == NGX_AGAIN || rc == NGX_DONE) { | |
972 return NGX_OK; | |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
973 } |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
974 |
681 | 975 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
976 | |
1806 | 977 if (clcf->satisfy == NGX_HTTP_SATISFY_ALL) { |
681 | 978 |
979 if (rc == NGX_OK) { | |
980 r->phase_handler++; | |
981 return NGX_AGAIN; | |
982 } | |
983 | |
984 } else { | |
985 if (rc == NGX_OK) { | |
986 r->access_code = 0; | |
987 | |
988 if (r->headers_out.www_authenticate) { | |
989 r->headers_out.www_authenticate->hash = 0; | |
990 } | |
991 | |
992 r->phase_handler = ph->next; | |
993 return NGX_AGAIN; | |
994 } | |
995 | |
996 if (rc == NGX_HTTP_FORBIDDEN || rc == NGX_HTTP_UNAUTHORIZED) { | |
997 r->access_code = rc; | |
998 | |
999 r->phase_handler++; | |
1000 return NGX_AGAIN; | |
1001 } | |
1002 } | |
1003 | |
1004 /* rc == NGX_ERROR || rc == NGX_HTTP_... */ | |
1005 | |
1006 ngx_http_finalize_request(r, rc); | |
1007 return NGX_OK; | |
1008 } | |
1009 | |
1010 | |
1011 ngx_int_t | |
1012 ngx_http_core_post_access_phase(ngx_http_request_t *r, | |
1013 ngx_http_phase_handler_t *ph) | |
1014 { | |
1015 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1016 "post access phase: %ui", r->phase_handler); | |
1017 | |
1018 if (r->access_code) { | |
1019 | |
1020 if (r->access_code == NGX_HTTP_FORBIDDEN) { | |
1021 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1022 "access forbidden by rule"); | |
1023 } | |
1024 | |
1025 ngx_http_finalize_request(r, r->access_code); | |
1026 return NGX_OK; | |
1027 } | |
1028 | |
1029 r->phase_handler++; | |
1030 return NGX_AGAIN; | |
1031 } | |
1032 | |
1033 | |
1034 ngx_int_t | |
2407 | 1035 ngx_http_core_try_files_phase(ngx_http_request_t *r, |
1036 ngx_http_phase_handler_t *ph) | |
1037 { | |
2481 | 1038 size_t len, root, alias, reserve, allocated; |
2407 | 1039 u_char *p, *name; |
1040 ngx_str_t path; | |
2458
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
1041 ngx_uint_t test_dir; |
2407 | 1042 ngx_http_try_file_t *tf; |
1043 ngx_open_file_info_t of; | |
1044 ngx_http_script_code_pt code; | |
1045 ngx_http_script_engine_t e; | |
1046 ngx_http_core_loc_conf_t *clcf; | |
1047 ngx_http_script_len_code_pt lcode; | |
1048 | |
1049 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1050 "try files phase: %ui", r->phase_handler); | |
1051 | |
1052 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1053 | |
1054 if (clcf->try_files == NULL) { | |
1055 r->phase_handler++; | |
1056 return NGX_AGAIN; | |
1057 } | |
1058 | |
1059 allocated = 0; | |
1060 root = 0; | |
1061 name = NULL; | |
2481 | 1062 /* suppress MSVC warning */ |
2407 | 1063 path.data = NULL; |
1064 | |
1065 tf = clcf->try_files; | |
1066 | |
1067 alias = clcf->alias ? clcf->name.len : 0; | |
1068 | |
1069 for ( ;; ) { | |
1070 | |
1071 if (tf->lengths) { | |
1072 ngx_memzero(&e, sizeof(ngx_http_script_engine_t)); | |
1073 | |
1074 e.ip = tf->lengths->elts; | |
1075 e.request = r; | |
1076 | |
1077 /* 1 is for terminating '\0' as in static names */ | |
1078 len = 1; | |
1079 | |
1080 while (*(uintptr_t *) e.ip) { | |
1081 lcode = *(ngx_http_script_len_code_pt *) e.ip; | |
1082 len += lcode(&e); | |
1083 } | |
1084 | |
1085 } else { | |
1086 len = tf->name.len; | |
1087 } | |
1088 | |
1089 /* 16 bytes are preallocation */ | |
2541
e73f70b4ca5c
fix case when the first try is shorter then URI
Igor Sysoev <igor@sysoev.ru>
parents:
2536
diff
changeset
|
1090 reserve = ngx_abs((ssize_t) (len - r->uri.len)) + alias + 16; |
2407 | 1091 |
1092 if (reserve > allocated) { | |
1093 | |
1094 /* we just need to allocate path and to copy a root */ | |
1095 | |
1096 if (ngx_http_map_uri_to_path(r, &path, &root, reserve) == NULL) { | |
1097 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
1098 return NGX_OK; | |
1099 } | |
1100 | |
1101 name = path.data + root; | |
1102 allocated = path.len - root - (r->uri.len - alias); | |
1103 } | |
1104 | |
1105 if (tf->values == NULL) { | |
1106 | |
1107 /* tf->name.len includes the terminating '\0' */ | |
1108 | |
1109 ngx_memcpy(name, tf->name.data, tf->name.len); | |
1110 | |
1111 path.len = (name + tf->name.len - 1) - path.data; | |
1112 | |
1113 } else { | |
1114 e.ip = tf->values->elts; | |
1115 e.pos = name; | |
2424
46d11bff21ef
flush variable values in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2423
diff
changeset
|
1116 e.flushed = 1; |
2407 | 1117 |
1118 while (*(uintptr_t *) e.ip) { | |
1119 code = *(ngx_http_script_code_pt *) e.ip; | |
1120 code((ngx_http_script_engine_t *) &e); | |
1121 } | |
1122 | |
1123 path.len = e.pos - path.data; | |
1124 | |
1125 *e.pos++ = '\0'; | |
1126 | |
1127 if (alias && ngx_strncmp(name, clcf->name.data, alias) == 0) { | |
1128 ngx_memcpy(name, name + alias, len - alias); | |
1129 path.len -= alias; | |
1130 } | |
1131 } | |
1132 | |
2458
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
1133 test_dir = tf->test_dir; |
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
1134 |
2407 | 1135 tf++; |
1136 | |
1137 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1138 "try to use file: \"%s\"", name); | |
1139 | |
1140 if (tf->lengths == NULL && tf->name.len == 0) { | |
1141 | |
1142 path.len -= root; | |
1143 path.data += root; | |
1144 | |
1145 if (path.data[0] == '@') { | |
1146 (void) ngx_http_named_location(r, &path); | |
1147 | |
1148 } else { | |
1149 (void) ngx_http_internal_redirect(r, &path, NULL); | |
1150 } | |
1151 | |
1152 return NGX_OK; | |
1153 } | |
1154 | |
1155 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); | |
1156 | |
1157 of.directio = clcf->directio; | |
1158 of.valid = clcf->open_file_cache_valid; | |
1159 of.min_uses = clcf->open_file_cache_min_uses; | |
1160 of.errors = clcf->open_file_cache_errors; | |
1161 of.events = clcf->open_file_cache_events; | |
1162 | |
1163 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) | |
1164 != NGX_OK) | |
1165 { | |
1166 if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) { | |
1167 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, | |
1168 ngx_open_file_n " \"%s\" failed", path.data); | |
1169 } | |
1170 | |
1171 continue; | |
1172 } | |
1173 | |
2458
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
1174 if (of.is_dir && !test_dir) { |
2453
1e53534e6800
try_files should work with files only
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
1175 continue; |
1e53534e6800
try_files should work with files only
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
1176 } |
1e53534e6800
try_files should work with files only
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
1177 |
2407 | 1178 path.len -= root; |
1179 path.data += root; | |
1180 | |
1181 if (!alias) { | |
1182 r->uri = path; | |
1183 | |
1184 } else { | |
1185 r->uri.len = alias + path.len; | |
1186 r->uri.data = ngx_pnalloc(r->pool, r->uri.len); | |
1187 if (r->uri.data == NULL) { | |
1188 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
1189 return NGX_OK; | |
1190 } | |
1191 | |
1192 p = ngx_copy(r->uri.data, clcf->name.data, alias); | |
1193 ngx_memcpy(p, name, path.len); | |
1194 } | |
1195 | |
2503
7b0711452b34
set content-type for try_files' choice
Igor Sysoev <igor@sysoev.ru>
parents:
2496
diff
changeset
|
1196 if (ngx_http_set_exten(r) != NGX_OK) { |
7b0711452b34
set content-type for try_files' choice
Igor Sysoev <igor@sysoev.ru>
parents:
2496
diff
changeset
|
1197 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
7b0711452b34
set content-type for try_files' choice
Igor Sysoev <igor@sysoev.ru>
parents:
2496
diff
changeset
|
1198 return NGX_OK; |
7b0711452b34
set content-type for try_files' choice
Igor Sysoev <igor@sysoev.ru>
parents:
2496
diff
changeset
|
1199 } |
7b0711452b34
set content-type for try_files' choice
Igor Sysoev <igor@sysoev.ru>
parents:
2496
diff
changeset
|
1200 |
2407 | 1201 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1202 "try file uri: \"%V\"", &r->uri); | |
1203 | |
1204 r->phase_handler++; | |
1205 return NGX_AGAIN; | |
1206 } | |
1207 | |
1208 /* not reached */ | |
1209 } | |
1210 | |
1211 | |
1212 ngx_int_t | |
681 | 1213 ngx_http_core_content_phase(ngx_http_request_t *r, |
1214 ngx_http_phase_handler_t *ph) | |
1215 { | |
773 | 1216 size_t root; |
681 | 1217 ngx_int_t rc; |
1218 ngx_str_t path; | |
1219 | |
1220 if (r->content_handler) { | |
1221 r->write_event_handler = ngx_http_request_empty_handler; | |
1222 ngx_http_finalize_request(r, r->content_handler(r)); | |
1223 return NGX_OK; | |
1224 } | |
1225 | |
1226 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1227 "content phase: %ui", r->phase_handler); | |
1228 | |
1229 rc = ph->handler(r); | |
1230 | |
1231 if (rc == NGX_DONE) { | |
1232 return NGX_OK; | |
1233 } | |
1234 | |
1235 if (rc != NGX_DECLINED) { | |
1236 ngx_http_finalize_request(r, rc); | |
1237 return NGX_OK; | |
1238 } | |
1239 | |
1240 /* rc == NGX_DECLINED */ | |
1241 | |
1242 ph++; | |
1243 | |
1244 if (ph->checker) { | |
1245 r->phase_handler++; | |
1246 return NGX_AGAIN; | |
1247 } | |
1248 | |
1249 /* no content handler was found */ | |
1250 | |
1251 if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { | |
1252 | |
773 | 1253 if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) { |
681 | 1254 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
1546
2956fb9b7dcb
omit trailing zero in directory name
Igor Sysoev <igor@sysoev.ru>
parents:
1489
diff
changeset
|
1255 "directory index of \"%s\" is forbidden", path.data); |
681 | 1256 } |
1257 | |
1258 ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN); | |
1259 return NGX_OK; | |
1260 } | |
1261 | |
1262 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no handler found"); | |
1263 | |
1264 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); | |
535 | 1265 return NGX_OK; |
1266 } | |
1267 | |
1268 | |
1269 void | |
1270 ngx_http_update_location_config(ngx_http_request_t *r) | |
1271 { | |
1272 ngx_http_core_loc_conf_t *clcf; | |
1273 | |
1274 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1275 | |
631 | 1276 if (r->method & clcf->limit_except) { |
1277 r->loc_conf = clcf->limit_except_loc_conf; | |
1278 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1279 } | |
1280 | |
643 | 1281 if (r == r->main) { |
1148 | 1282 r->connection->log->file = clcf->err_log->file; |
1283 | |
643 | 1284 if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) { |
1285 r->connection->log->log_level = clcf->err_log->log_level; | |
1286 } | |
535 | 1287 } |
1288 | |
1289 if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) { | |
1290 r->connection->sendfile = 1; | |
1291 | |
1292 } else { | |
1293 r->connection->sendfile = 0; | |
1294 } | |
1295 | |
633 | 1296 if (clcf->client_body_in_file_only) { |
1297 r->request_body_in_file_only = 1; | |
1298 r->request_body_in_persistent_file = 1; | |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1073
diff
changeset
|
1299 r->request_body_in_clean_file = |
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1073
diff
changeset
|
1300 clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_CLEAN; |
637 | 1301 r->request_body_file_log_level = NGX_LOG_NOTICE; |
1302 | |
1303 } else { | |
1304 r->request_body_file_log_level = NGX_LOG_WARN; | |
633 | 1305 } |
1306 | |
535 | 1307 if (r->keepalive && clcf->keepalive_timeout == 0) { |
1308 r->keepalive = 0; | |
1309 } | |
1310 | |
1311 if (!clcf->tcp_nopush) { | |
1312 /* disable TCP_NOPUSH/TCP_CORK use */ | |
1313 r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED; | |
1314 } | |
1315 | |
613 | 1316 if (r->limit_rate == 0) { |
1317 r->limit_rate = clcf->limit_rate; | |
1318 } | |
527 | 1319 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
1320 if (clcf->handler) { |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
1321 r->content_handler = clcf->handler; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
1322 } |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
1323 } |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
1324 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
1325 |
2186
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1326 /* |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1327 * NGX_OK - exact or regex match |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1328 * NGX_DONE - auto redirect |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1329 * NGX_AGAIN - inclusive match |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1330 * NGX_ERROR - regex error |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1331 * NGX_DECLINED - no match |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1332 */ |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1333 |
487 | 1334 static ngx_int_t |
2027 | 1335 ngx_http_core_find_location(ngx_http_request_t *r) |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1336 { |
2027 | 1337 ngx_int_t rc; |
1338 ngx_http_core_loc_conf_t *pclcf; | |
2185
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1339 #if (NGX_PCRE) |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1340 ngx_int_t n; |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1341 ngx_uint_t noregex; |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1342 ngx_http_core_loc_conf_t *clcf, **clcfp; |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1343 |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1344 noregex = 0; |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1345 #endif |
2027 | 1346 |
1347 pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1348 | |
1349 rc = ngx_http_core_find_static_location(r, pclcf->static_locations); | |
1350 | |
1351 if (rc == NGX_AGAIN) { | |
2185
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1352 |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1353 #if (NGX_PCRE) |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1354 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1355 |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1356 noregex = clcf->noregex; |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1357 #endif |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1358 |
2027 | 1359 /* look up nested locations */ |
2185
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1360 |
2027 | 1361 rc = ngx_http_core_find_location(r); |
1362 } | |
1363 | |
1364 if (rc == NGX_OK || rc == NGX_DONE) { | |
1365 return rc; | |
1366 } | |
1367 | |
1368 /* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */ | |
1369 | |
1370 #if (NGX_PCRE) | |
2185
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1371 |
e9420c1b6f25
fix noregex for inclusive locations
Igor Sysoev <igor@sysoev.ru>
parents:
2138
diff
changeset
|
1372 if (noregex == 0 && pclcf->regex_locations) { |
2027 | 1373 |
1374 for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) { | |
1375 | |
1376 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1377 "test location: ~ \"%V\"", &(*clcfp)->name); | |
1378 | |
1379 n = ngx_regex_exec((*clcfp)->regex, &r->uri, NULL, 0); | |
1380 | |
1381 if (n == NGX_REGEX_NO_MATCHED) { | |
1382 continue; | |
1383 } | |
1384 | |
1385 if (n < 0) { | |
1386 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
1387 ngx_regex_exec_n | |
1388 " failed: %d on \"%V\" using \"%V\"", | |
1389 n, &r->uri, &(*clcfp)->name); | |
2186
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1390 return NGX_ERROR; |
2027 | 1391 } |
1392 | |
1393 /* match */ | |
1394 | |
1395 r->loc_conf = (*clcfp)->loc_conf; | |
1396 | |
1397 /* look up nested locations */ | |
1398 | |
2186
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1399 rc = ngx_http_core_find_location(r); |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1400 |
ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
Igor Sysoev <igor@sysoev.ru>
parents:
2185
diff
changeset
|
1401 return (rc == NGX_ERROR) ? rc : NGX_OK; |
2027 | 1402 } |
1403 } | |
1386
3c6da0610f19
fix building by bcc without PCRE
Igor Sysoev <igor@sysoev.ru>
parents:
1377
diff
changeset
|
1404 #endif |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1405 |
2027 | 1406 return rc; |
1407 } | |
1408 | |
1409 | |
1410 /* | |
1411 * NGX_OK - exact match | |
1412 * NGX_DONE - auto redirect | |
1413 * NGX_AGAIN - inclusive match | |
1414 * NGX_DECLINED - no match | |
1415 */ | |
1416 | |
1417 static ngx_int_t | |
1418 ngx_http_core_find_static_location(ngx_http_request_t *r, | |
1419 ngx_http_location_tree_node_t *node) | |
1420 { | |
1421 u_char *uri; | |
1422 size_t len, n; | |
1423 ngx_int_t rc, rv; | |
1424 | |
1425 len = r->uri.len; | |
1426 uri = r->uri.data; | |
1427 | |
1428 rv = NGX_DECLINED; | |
1429 | |
1430 for ( ;; ) { | |
1431 | |
1432 if (node == NULL) { | |
1433 return rv; | |
485 | 1434 } |
1435 | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1436 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2027 | 1437 "test location: \"%*s\"", node->len, node->name); |
1438 | |
1439 n = (len <= (size_t) node->len) ? len : node->len; | |
1440 | |
2126
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
2085
diff
changeset
|
1441 rc = ngx_filename_cmp(uri, node->name, n); |
2027 | 1442 |
1443 if (rc != 0) { | |
1444 node = (rc < 0) ? node->left : node->right; | |
1445 | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1446 continue; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1447 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1448 |
2027 | 1449 if (len > (size_t) node->len) { |
1450 | |
1451 if (node->inclusive) { | |
1452 | |
1453 r->loc_conf = node->inclusive->loc_conf; | |
1454 rv = NGX_AGAIN; | |
1455 | |
1456 node = node->tree; | |
1457 uri += n; | |
1458 len -= n; | |
485 | 1459 |
1460 continue; | |
400
69e851f83522
nginx-0.0.8-2004-07-26-20:21:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
396
diff
changeset
|
1461 } |
69e851f83522
nginx-0.0.8-2004-07-26-20:21:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
396
diff
changeset
|
1462 |
2027 | 1463 /* exact only */ |
1464 | |
1465 node = node->right; | |
1466 | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1467 continue; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1468 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1469 |
2027 | 1470 if (len == (size_t) node->len) { |
1471 | |
1472 r->loc_conf = (node->exact) ? node->exact->loc_conf: | |
1473 node->inclusive->loc_conf; | |
1474 return NGX_OK; | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1475 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1476 |
2027 | 1477 /* len < node->len */ |
1478 | |
1479 if (len + 1 == (size_t) node->len && node->auto_redirect) { | |
1480 | |
1481 r->loc_conf = (node->exact) ? node->exact->loc_conf: | |
1482 node->inclusive->loc_conf; | |
1483 rv = NGX_DONE; | |
1484 } | |
1485 | |
1486 node = node->left; | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1487 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1488 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1489 |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
1490 |
2138 | 1491 void * |
1492 ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash) | |
1493 { | |
1494 u_char c, *p; | |
1495 ngx_uint_t i, hash; | |
1496 | |
1497 if (r->headers_out.content_type.len == 0) { | |
1498 return NULL; | |
1499 } | |
1500 | |
1501 if (r->headers_out.content_type_lowcase == NULL) { | |
1502 | |
1503 p = ngx_pnalloc(r->pool, r->headers_out.content_type_len); | |
1504 | |
1505 if (p == NULL) { | |
1506 return NULL; | |
1507 } | |
1508 | |
1509 r->headers_out.content_type_lowcase = p; | |
1510 | |
1511 hash = 0; | |
1512 | |
1513 for (i = 0; i < r->headers_out.content_type_len; i++) { | |
1514 c = ngx_tolower(r->headers_out.content_type.data[i]); | |
1515 hash = ngx_hash(hash, c); | |
1516 *p++ = c; | |
1517 } | |
1518 | |
1519 r->headers_out.content_type_hash = hash; | |
1520 } | |
1521 | |
1522 return ngx_hash_find(types_hash, | |
1523 r->headers_out.content_type_hash, | |
1524 r->headers_out.content_type_lowcase, | |
1525 r->headers_out.content_type_len); | |
1526 } | |
1527 | |
1528 | |
487 | 1529 ngx_int_t |
1530 ngx_http_set_content_type(ngx_http_request_t *r) | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1531 { |
2136 | 1532 u_char c, *exten; |
589 | 1533 ngx_str_t *type; |
649 | 1534 ngx_uint_t i, hash; |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1535 ngx_http_core_loc_conf_t *clcf; |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1536 |
673 | 1537 if (r->headers_out.content_type.len) { |
1538 return NGX_OK; | |
1539 } | |
1540 | |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1541 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1542 |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1543 if (r->exten.len) { |
485 | 1544 |
649 | 1545 hash = 0; |
1546 | |
1547 for (i = 0; i < r->exten.len; i++) { | |
1548 c = r->exten.data[i]; | |
1549 | |
1550 if (c >= 'A' && c <= 'Z') { | |
1551 | |
2136 | 1552 exten = ngx_pnalloc(r->pool, r->exten.len); |
1553 if (exten == NULL) { | |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
1554 return NGX_ERROR; |
485 | 1555 } |
1556 | |
2136 | 1557 hash = ngx_hash_strlow(exten, r->exten.data, r->exten.len); |
485 | 1558 |
1559 r->exten.data = exten; | |
649 | 1560 |
1561 break; | |
485 | 1562 } |
1563 | |
649 | 1564 hash = ngx_hash(hash, c); |
485 | 1565 } |
1566 | |
649 | 1567 type = ngx_hash_find(&clcf->types_hash, hash, |
589 | 1568 r->exten.data, r->exten.len); |
1569 | |
1570 if (type) { | |
657 | 1571 r->headers_out.content_type_len = type->len; |
589 | 1572 r->headers_out.content_type = *type; |
657 | 1573 |
589 | 1574 return NGX_OK; |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1575 } |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1576 } |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1577 |
657 | 1578 r->headers_out.content_type_len = clcf->default_type.len; |
589 | 1579 r->headers_out.content_type = clcf->default_type; |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1580 |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1581 return NGX_OK; |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1582 } |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1583 |
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
1584 |
487 | 1585 ngx_int_t |
1586 ngx_http_set_exten(ngx_http_request_t *r) | |
216
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1587 { |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1588 ngx_int_t i; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1589 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1590 r->exten.len = 0; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1591 r->exten.data = NULL; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1592 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1593 for (i = r->uri.len - 1; i > 1; i--) { |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1594 if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { |
649 | 1595 |
216
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1596 r->exten.len = r->uri.len - i - 1; |
649 | 1597 r->exten.data = &r->uri.data[i + 1]; |
216
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1598 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1599 break; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1600 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1601 } else if (r->uri.data[i] == '/') { |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1602 break; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1603 } |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1604 } |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1605 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1606 return NGX_OK; |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1607 } |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1608 |
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
1609 |
487 | 1610 ngx_int_t |
557 | 1611 ngx_http_send_header(ngx_http_request_t *r) |
1612 { | |
1613 if (r->err_status) { | |
1614 r->headers_out.status = r->err_status; | |
1615 r->headers_out.status_line.len = 0; | |
1616 } | |
1617 | |
1618 return ngx_http_top_header_filter(r); | |
1619 } | |
1620 | |
1621 | |
1622 ngx_int_t | |
1623 ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in) | |
1624 { | |
1625 ngx_int_t rc; | |
1626 | |
583 | 1627 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1628 "http output filter \"%V?%V\"", &r->uri, &r->args); | |
557 | 1629 |
1630 rc = ngx_http_top_body_filter(r, in); | |
1631 | |
1632 if (rc == NGX_ERROR) { | |
1633 /* NGX_ERROR may be returned by any filter */ | |
583 | 1634 r->connection->error = 1; |
557 | 1635 } |
1636 | |
1637 return rc; | |
1638 } | |
1639 | |
1640 | |
1641 u_char * | |
1642 ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path, | |
773 | 1643 size_t *root_length, size_t reserved) |
557 | 1644 { |
623 | 1645 u_char *last; |
1646 size_t alias; | |
1647 ngx_http_core_loc_conf_t *clcf; | |
557 | 1648 |
1649 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1650 | |
1651 alias = clcf->alias ? clcf->name.len : 0; | |
1652 | |
603 | 1653 if (alias && !r->valid_location) { |
1654 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | |
1655 "\"alias\" could not be used in location \"%V\" " | |
1656 "where URI was rewritten", &clcf->name); | |
1657 return NULL; | |
1658 } | |
1659 | |
623 | 1660 reserved += r->uri.len - alias + 1; |
1661 | |
595 | 1662 if (clcf->root_lengths == NULL) { |
1663 | |
773 | 1664 *root_length = clcf->root.len; |
595 | 1665 |
623 | 1666 path->len = clcf->root.len + reserved; |
595 | 1667 |
2049 | 1668 path->data = ngx_pnalloc(r->pool, path->len); |
595 | 1669 if (path->data == NULL) { |
1670 return NULL; | |
1671 } | |
1672 | |
1673 last = ngx_copy(path->data, clcf->root.data, clcf->root.len); | |
623 | 1674 |
1675 } else { | |
667 | 1676 if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved, |
671 | 1677 clcf->root_values->elts) |
667 | 1678 == NULL) |
1679 { | |
1680 return NULL; | |
1681 } | |
1682 | |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
1683 if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, path, 0) != NGX_OK) { |
623 | 1684 return NULL; |
1685 } | |
1686 | |
773 | 1687 *root_length = path->len - reserved; |
1688 last = path->data + *root_length; | |
595 | 1689 } |
1690 | |
623 | 1691 last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1); |
557 | 1692 |
1693 return last; | |
1694 } | |
1695 | |
1696 | |
1697 ngx_int_t | |
539 | 1698 ngx_http_auth_basic_user(ngx_http_request_t *r) |
1699 { | |
1700 ngx_str_t auth, encoded; | |
1701 ngx_uint_t len; | |
1702 | |
1703 if (r->headers_in.user.len == 0 && r->headers_in.user.data != NULL) { | |
1704 return NGX_DECLINED; | |
1705 } | |
1706 | |
1707 if (r->headers_in.authorization == NULL) { | |
1708 r->headers_in.user.data = (u_char *) ""; | |
1709 return NGX_DECLINED; | |
1710 } | |
1711 | |
1712 encoded = r->headers_in.authorization->value; | |
1713 | |
1714 if (encoded.len < sizeof("Basic ") - 1 | |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
1715 || ngx_strncasecmp(encoded.data, (u_char *) "Basic ", |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
1716 sizeof("Basic ") - 1) |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
1717 != 0) |
539 | 1718 { |
1719 r->headers_in.user.data = (u_char *) ""; | |
1720 return NGX_DECLINED; | |
1721 } | |
1722 | |
1723 encoded.len -= sizeof("Basic ") - 1; | |
1724 encoded.data += sizeof("Basic ") - 1; | |
1725 | |
1726 while (encoded.len && encoded.data[0] == ' ') { | |
1727 encoded.len--; | |
1728 encoded.data++; | |
1729 } | |
1730 | |
1731 if (encoded.len == 0) { | |
1732 r->headers_in.user.data = (u_char *) ""; | |
1733 return NGX_DECLINED; | |
1734 } | |
577 | 1735 |
539 | 1736 auth.len = ngx_base64_decoded_length(encoded.len); |
2049 | 1737 auth.data = ngx_pnalloc(r->pool, auth.len + 1); |
539 | 1738 if (auth.data == NULL) { |
1739 return NGX_ERROR; | |
1740 } | |
1741 | |
1742 if (ngx_decode_base64(&auth, &encoded) != NGX_OK) { | |
1743 r->headers_in.user.data = (u_char *) ""; | |
1744 return NGX_DECLINED; | |
1745 } | |
577 | 1746 |
539 | 1747 auth.data[auth.len] = '\0'; |
577 | 1748 |
1749 for (len = 0; len < auth.len; len++) { | |
539 | 1750 if (auth.data[len] == ':') { |
1751 break; | |
1752 } | |
1753 } | |
577 | 1754 |
573 | 1755 if (len == 0 || len == auth.len) { |
539 | 1756 r->headers_in.user.data = (u_char *) ""; |
1757 return NGX_DECLINED; | |
1758 } | |
1759 | |
1760 r->headers_in.user.len = len; | |
1761 r->headers_in.user.data = auth.data; | |
1762 r->headers_in.passwd.len = auth.len - len - 1; | |
1763 r->headers_in.passwd.data = &auth.data[len + 1]; | |
1764 | |
1765 return NGX_OK; | |
1766 } | |
1767 | |
1768 | |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1769 ngx_int_t |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1770 ngx_http_server_addr(ngx_http_request_t *r, ngx_str_t *s) |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1771 { |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1772 socklen_t len; |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1773 ngx_connection_t *c; |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1774 u_char sa[NGX_SOCKADDRLEN]; |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1775 |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1776 c = r->connection; |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1777 |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1778 if (c->local_sockaddr == NULL) { |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1779 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1780 len = NGX_SOCKADDRLEN; |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1781 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1782 if (getsockname(c->fd, (struct sockaddr *) &sa, &len) == -1) { |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1783 ngx_connection_error(c, ngx_socket_errno, "getsockname() failed"); |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1784 return NGX_ERROR; |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1785 } |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1786 |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1787 c->local_sockaddr = ngx_palloc(r->connection->pool, len); |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1788 if (c->local_sockaddr == NULL) { |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1789 return NGX_ERROR; |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1790 } |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1791 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1792 c->local_socklen = len; |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1793 ngx_memcpy(c->local_sockaddr, &sa, len); |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1794 } |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1795 |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1796 if (s == NULL) { |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1797 return NGX_OK; |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1798 } |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1799 |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
1800 s->len = ngx_sock_ntop(c->local_sockaddr, s->data, s->len, 0); |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1801 |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1802 return NGX_OK; |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1803 } |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1804 |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
1805 |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1806 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1807 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1808 ngx_int_t |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1809 ngx_http_gzip_ok(ngx_http_request_t *r) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1810 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1811 time_t date, expires; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1812 ngx_uint_t p; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1813 ngx_array_t *cc; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1814 ngx_table_elt_t *e, *d; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1815 ngx_http_core_loc_conf_t *clcf; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1816 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1817 if (r->gzip == 1) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1818 return NGX_OK; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1819 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1820 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1821 if (r->gzip == 2) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1822 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1823 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1824 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1825 r->gzip = 2; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1826 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1827 if (r != r->main |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1828 || r->headers_in.accept_encoding == NULL |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1829 || ngx_strcasestrn(r->headers_in.accept_encoding->value.data, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1830 "gzip", 4 - 1) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1831 == NULL |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1832 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1833 /* |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1834 * if the URL (without the "http://" prefix) is longer than 253 bytes, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1835 * then MSIE 4.x can not handle the compressed stream - it waits |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1836 * too long, hangs up or crashes |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1837 */ |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1838 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1839 || (r->headers_in.msie4 && r->unparsed_uri.len > 200)) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1840 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1841 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1842 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1843 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1844 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1845 |
2205 | 1846 if (r->headers_in.msie6 && clcf->gzip_disable_msie6) { |
1847 return NGX_DECLINED; | |
1848 } | |
1849 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1850 if (r->http_version < clcf->gzip_http_version) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1851 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1852 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1853 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1854 if (r->headers_in.via == NULL) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1855 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1856 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1857 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1858 p = clcf->gzip_proxied; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1859 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1860 if (p & NGX_HTTP_GZIP_PROXIED_OFF) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1861 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1862 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1863 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1864 if (p & NGX_HTTP_GZIP_PROXIED_ANY) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1865 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1866 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1867 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1868 if (r->headers_in.authorization && (p & NGX_HTTP_GZIP_PROXIED_AUTH)) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1869 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1870 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1871 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1872 e = r->headers_out.expires; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1873 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1874 if (e) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1875 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1876 if (!(p & NGX_HTTP_GZIP_PROXIED_EXPIRED)) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1877 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1878 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1879 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1880 expires = ngx_http_parse_time(e->value.data, e->value.len); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1881 if (expires == NGX_ERROR) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1882 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1883 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1884 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1885 d = r->headers_out.date; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1886 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1887 if (d) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1888 date = ngx_http_parse_time(d->value.data, d->value.len); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1889 if (date == NGX_ERROR) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1890 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1891 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1892 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1893 } else { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1894 date = ngx_time(); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1895 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1896 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1897 if (expires < date) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1898 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1899 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1900 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1901 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1902 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1903 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1904 cc = &r->headers_out.cache_control; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1905 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1906 if (cc->elts) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1907 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1908 if ((p & NGX_HTTP_GZIP_PROXIED_NO_CACHE) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1909 && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_cache, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1910 NULL) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1911 >= 0) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1912 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1913 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1914 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1915 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1916 if ((p & NGX_HTTP_GZIP_PROXIED_NO_STORE) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1917 && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_store, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1918 NULL) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1919 >= 0) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1920 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1921 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1922 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1923 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1924 if ((p & NGX_HTTP_GZIP_PROXIED_PRIVATE) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1925 && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_private, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1926 NULL) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1927 >= 0) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1928 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1929 goto ok; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1930 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1931 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1932 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1933 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1934 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1935 if ((p & NGX_HTTP_GZIP_PROXIED_NO_LM) && r->headers_out.last_modified) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1936 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1937 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1938 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1939 if ((p & NGX_HTTP_GZIP_PROXIED_NO_ETAG) && r->headers_out.etag) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1940 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1941 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1942 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1943 ok: |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1944 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1945 #if (NGX_PCRE) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1946 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1947 if (clcf->gzip_disable && r->headers_in.user_agent) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1948 |
1801
a4cb9c04e7f2
style fix: remove trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
1800
diff
changeset
|
1949 if (ngx_regex_exec_array(clcf->gzip_disable, |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1950 &r->headers_in.user_agent->value, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1951 r->connection->log) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1952 != NGX_DECLINED) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1953 { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1954 return NGX_DECLINED; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1955 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1956 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1957 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1958 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1959 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1960 r->gzip = 1; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1961 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1962 return NGX_OK; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1963 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1964 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1965 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1966 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
1967 |
539 | 1968 ngx_int_t |
509 | 1969 ngx_http_subrequest(ngx_http_request_t *r, |
758
86bb73dc8d40
fix <!--#include virtual=... wait="yes" -->
Igor Sysoev <igor@sysoev.ru>
parents:
716
diff
changeset
|
1970 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr, |
777
4ab852b691f5
<!--#include virtual=... set=... -->
Igor Sysoev <igor@sysoev.ru>
parents:
773
diff
changeset
|
1971 ngx_http_post_subrequest_t *ps, ngx_uint_t flags) |
509 | 1972 { |
583 | 1973 ngx_connection_t *c; |
509 | 1974 ngx_http_request_t *sr; |
1975 ngx_http_core_srv_conf_t *cscf; | |
1976 ngx_http_postponed_request_t *pr, *p; | |
1977 | |
657 | 1978 r->main->subrequests--; |
1979 | |
1980 if (r->main->subrequests == 0) { | |
1981 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
679 | 1982 "subrequests cycle while processing \"%V\"", uri); |
838 | 1983 r->main->subrequests = 1; |
657 | 1984 return NGX_ERROR; |
1985 } | |
1986 | |
509 | 1987 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); |
1988 if (sr == NULL) { | |
645 | 1989 return NGX_ERROR; |
509 | 1990 } |
1991 | |
1992 sr->signature = NGX_HTTP_MODULE; | |
583 | 1993 |
1994 c = r->connection; | |
1995 sr->connection = c; | |
509 | 1996 |
1997 sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); | |
1998 if (sr->ctx == NULL) { | |
645 | 1999 return NGX_ERROR; |
509 | 2000 } |
2001 | |
2002 if (ngx_list_init(&sr->headers_out.headers, r->pool, 20, | |
581 | 2003 sizeof(ngx_table_elt_t)) |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
2004 != NGX_OK) |
509 | 2005 { |
645 | 2006 return NGX_ERROR; |
509 | 2007 } |
2008 | |
2009 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | |
2010 sr->main_conf = cscf->ctx->main_conf; | |
2011 sr->srv_conf = cscf->ctx->srv_conf; | |
2012 sr->loc_conf = cscf->ctx->loc_conf; | |
2013 | |
2014 sr->pool = r->pool; | |
2015 | |
2016 sr->headers_in = r->headers_in; | |
2017 | |
577 | 2018 ngx_http_clear_content_length(sr); |
2019 ngx_http_clear_accept_ranges(sr); | |
2020 ngx_http_clear_last_modified(sr); | |
509 | 2021 |
2022 sr->request_body = r->request_body; | |
2023 | |
2024 sr->method = NGX_HTTP_GET; | |
2025 sr->http_version = r->http_version; | |
2026 | |
2027 sr->request_line = r->request_line; | |
2028 sr->uri = *uri; | |
573 | 2029 |
509 | 2030 if (args) { |
2031 sr->args = *args; | |
2032 } | |
573 | 2033 |
583 | 2034 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, |
2035 "http subrequest \"%V?%V\"", uri, &sr->args); | |
2036 | |
777
4ab852b691f5
<!--#include virtual=... set=... -->
Igor Sysoev <igor@sysoev.ru>
parents:
773
diff
changeset
|
2037 sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0; |
4ab852b691f5
<!--#include virtual=... set=... -->
Igor Sysoev <igor@sysoev.ru>
parents:
773
diff
changeset
|
2038 sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0; |
2377
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2039 sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0; |
573 | 2040 |
509 | 2041 sr->unparsed_uri = r->unparsed_uri; |
1857
18c20c38ad6d
update GET method text in an subrequest
Igor Sysoev <igor@sysoev.ru>
parents:
1811
diff
changeset
|
2042 sr->method_name = ngx_http_core_get_method; |
509 | 2043 sr->http_protocol = r->http_protocol; |
2044 | |
2045 if (ngx_http_set_exten(sr) != NGX_OK) { | |
645 | 2046 return NGX_ERROR; |
509 | 2047 } |
2048 | |
553 | 2049 sr->main = r->main; |
509 | 2050 sr->parent = r; |
777
4ab852b691f5
<!--#include virtual=... set=... -->
Igor Sysoev <igor@sysoev.ru>
parents:
773
diff
changeset
|
2051 sr->post_subrequest = ps; |
509 | 2052 sr->read_event_handler = ngx_http_request_empty_handler; |
2377
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2053 sr->write_event_handler = ngx_http_handler; |
509 | 2054 |
2423 | 2055 if (c->data == r && r->postponed == NULL) { |
583 | 2056 c->data = sr; |
509 | 2057 } |
2058 | |
2059 sr->variables = r->variables; | |
2060 | |
2061 sr->log_handler = r->log_handler; | |
2062 | |
2063 pr = ngx_palloc(r->pool, sizeof(ngx_http_postponed_request_t)); | |
2064 if (pr == NULL) { | |
645 | 2065 return NGX_ERROR; |
509 | 2066 } |
2067 | |
2068 pr->request = sr; | |
2069 pr->out = NULL; | |
2070 pr->next = NULL; | |
2071 | |
2072 if (r->postponed) { | |
2073 for (p = r->postponed; p->next; p = p->next) { /* void */ } | |
2074 p->next = pr; | |
2075 | |
2076 } else { | |
2077 r->postponed = pr; | |
2078 } | |
2079 | |
2080 sr->internal = 1; | |
2081 | |
543 | 2082 sr->discard_body = r->discard_body; |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2435
diff
changeset
|
2083 sr->expect_tested = 1; |
513 | 2084 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; |
2085 | |
651 | 2086 sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1; |
2087 | |
2377
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2088 r->main->subrequests++; |
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2089 |
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2090 *psr = sr; |
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2091 |
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2361
diff
changeset
|
2092 return ngx_http_post_request(sr); |
509 | 2093 } |
2094 | |
2095 | |
2096 ngx_int_t | |
487 | 2097 ngx_http_internal_redirect(ngx_http_request_t *r, |
2098 ngx_str_t *uri, ngx_str_t *args) | |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
2099 { |
487 | 2100 ngx_http_core_srv_conf_t *cscf; |
2101 | |
677 | 2102 r->uri_changes--; |
2103 | |
2104 if (r->uri_changes == 0) { | |
2105 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
679 | 2106 "rewrite or internal redirection cycle " |
2107 "while internal redirect to \"%V\"", uri); | |
2108 | |
677 | 2109 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
2110 return NGX_DONE; | |
2111 } | |
2112 | |
461 | 2113 r->uri = *uri; |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2114 |
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2115 if (args) { |
461 | 2116 r->args = *args; |
509 | 2117 |
2118 } else { | |
2119 r->args.len = 0; | |
2120 r->args.data = NULL; | |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2121 } |
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2122 |
583 | 2123 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2124 "internal redirect: \"%V?%V\"", uri, &r->args); | |
2125 | |
216
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
2126 if (ngx_http_set_exten(r) != NGX_OK) { |
677 | 2127 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
2128 return NGX_DONE; | |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2129 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
2130 |
675 | 2131 /* clear the modules contexts */ |
2132 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2133 |
487 | 2134 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |
2135 r->loc_conf = cscf->ctx->loc_conf; | |
2136 | |
535 | 2137 ngx_http_update_location_config(r); |
2138 | |
509 | 2139 r->internal = 1; |
2140 | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2141 ngx_http_handler(r); |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
2142 |
152
fb48bf4fea1c
nginx-0.0.1-2003-10-21-11:47:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
2143 return NGX_DONE; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
2144 } |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
2145 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
19
diff
changeset
|
2146 |
1353 | 2147 ngx_int_t |
2148 ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name) | |
2149 { | |
2150 ngx_http_core_srv_conf_t *cscf; | |
2151 ngx_http_core_loc_conf_t **clcfp; | |
2152 ngx_http_core_main_conf_t *cmcf; | |
2153 | |
2154 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | |
2155 | |
2404
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2156 if (cscf->named_locations) { |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2157 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2158 for (clcfp = cscf->named_locations; *clcfp; clcfp++) { |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2159 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2160 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2161 "test location: \"%V\"", &(*clcfp)->name); |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2162 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2163 if (name->len != (*clcfp)->name.len |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2164 || ngx_strncmp(name->data, (*clcfp)->name.data, name->len) != 0) |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2165 { |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2166 continue; |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2167 } |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2168 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2169 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2170 "using location: %V \"%V?%V\"", |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2171 name, &r->uri, &r->args); |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2172 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2173 r->internal = 1; |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2174 r->content_handler = NULL; |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2175 r->loc_conf = (*clcfp)->loc_conf; |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2176 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2177 ngx_http_update_location_config(r); |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2178 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2179 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2180 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2181 r->phase_handler = cmcf->phase_engine.location_rewrite_index; |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2182 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2183 ngx_http_core_run_phases(r); |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2184 |
dca164c4a868
fix segfault if no named location are defined, but are used
Igor Sysoev <igor@sysoev.ru>
parents:
2400
diff
changeset
|
2185 return NGX_DONE; |
1353 | 2186 } |
2187 } | |
2188 | |
2189 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1591 | 2190 "could not find named location \"%V\"", name); |
1353 | 2191 |
2192 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
2027 | 2193 |
1353 | 2194 return NGX_DONE; |
2195 } | |
2196 | |
2197 | |
569 | 2198 ngx_http_cleanup_t * |
2199 ngx_http_cleanup_add(ngx_http_request_t *r, size_t size) | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2200 { |
569 | 2201 ngx_http_cleanup_t *cln; |
2202 | |
2203 r = r->main; | |
2204 | |
2205 cln = ngx_palloc(r->pool, sizeof(ngx_http_cleanup_t)); | |
2206 if (cln == NULL) { | |
2207 return NULL; | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2208 } |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2209 |
569 | 2210 if (size) { |
2211 cln->data = ngx_palloc(r->pool, size); | |
2212 if (cln->data == NULL) { | |
2213 return NULL; | |
2214 } | |
2215 | |
2216 } else { | |
2217 cln->data = NULL; | |
2218 } | |
2219 | |
2220 cln->handler = NULL; | |
2221 cln->next = r->cleanup; | |
2222 | |
2223 r->cleanup = cln; | |
2224 | |
2225 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
2226 "http cleanup add: %p", cln); | |
2227 | |
2228 return cln; | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2229 } |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2230 |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
2231 |
487 | 2232 static char * |
2233 ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2234 { |
1235
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2235 char *rv; |
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2236 void *mconf; |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2237 ngx_uint_t i; |
1235
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2238 ngx_conf_t pcf; |
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2239 ngx_http_module_t *module; |
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2240 ngx_http_conf_ctx_t *ctx, *http_ctx; |
f8a40ccafb04
optimize regex location search
Igor Sysoev <igor@sysoev.ru>
parents:
1234
diff
changeset
|
2241 ngx_http_core_srv_conf_t *cscf, **cscfp; |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2242 ngx_http_core_main_conf_t *cmcf; |
487 | 2243 |
501 | 2244 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); |
2245 if (ctx == NULL) { | |
487 | 2246 return NGX_CONF_ERROR; |
2247 } | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2248 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2249 http_ctx = cf->ctx; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2250 ctx->main_conf = http_ctx->main_conf; |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
2251 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2252 /* the server{}'s srv_conf */ |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
2253 |
487 | 2254 ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
2255 if (ctx->srv_conf == NULL) { | |
2256 return NGX_CONF_ERROR; | |
2257 } | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2258 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2259 /* the server{}'s loc_conf */ |
90
37530da31268
nginx-0.0.1-2003-05-16-19:27:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
89
diff
changeset
|
2260 |
487 | 2261 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
2262 if (ctx->loc_conf == NULL) { | |
2263 return NGX_CONF_ERROR; | |
2264 } | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2265 |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2266 for (i = 0; ngx_modules[i]; i++) { |
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2267 if (ngx_modules[i]->type != NGX_HTTP_MODULE) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2268 continue; |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2269 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2270 |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2271 module = ngx_modules[i]->ctx; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2272 |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2273 if (module->create_srv_conf) { |
501 | 2274 mconf = module->create_srv_conf(cf); |
2275 if (mconf == NULL) { | |
487 | 2276 return NGX_CONF_ERROR; |
2277 } | |
2278 | |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2279 ctx->srv_conf[ngx_modules[i]->ctx_index] = mconf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2280 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2281 |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2282 if (module->create_loc_conf) { |
501 | 2283 mconf = module->create_loc_conf(cf); |
2284 if (mconf == NULL) { | |
487 | 2285 return NGX_CONF_ERROR; |
2286 } | |
2287 | |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2288 ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2289 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2290 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2291 |
487 | 2292 |
2293 /* the server configuration context */ | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2294 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
2295 cscf = ctx->srv_conf[ngx_http_core_module.ctx_index]; |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2296 cscf->ctx = ctx; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2297 |
487 | 2298 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
2299 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; |
487 | 2300 |
501 | 2301 cscfp = ngx_array_push(&cmcf->servers); |
2302 if (cscfp == NULL) { | |
487 | 2303 return NGX_CONF_ERROR; |
2304 } | |
2305 | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2306 *cscfp = cscf; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2307 |
487 | 2308 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2309 /* parse inside server{} */ |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2310 |
521 | 2311 pcf = *cf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2312 cf->ctx = ctx; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2313 cf->cmd_type = NGX_HTTP_SRV_CONF; |
485 | 2314 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2315 rv = ngx_conf_parse(cf, NULL); |
485 | 2316 |
521 | 2317 *cf = pcf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2318 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2319 return rv; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2320 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2321 |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2322 |
487 | 2323 static char * |
2324 ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2325 { |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2326 char *rv; |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2327 u_char *mod; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2328 size_t len; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2329 ngx_str_t *value, *name; |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2330 ngx_uint_t i; |
485 | 2331 ngx_conf_t save; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2332 ngx_http_module_t *module; |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2333 ngx_http_conf_ctx_t *ctx, *pctx; |
2027 | 2334 ngx_http_core_loc_conf_t *clcf, *pclcf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2335 |
501 | 2336 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); |
2337 if (ctx == NULL) { | |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2338 return NGX_CONF_ERROR; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2339 } |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2340 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2341 pctx = cf->ctx; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2342 ctx->main_conf = pctx->main_conf; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2343 ctx->srv_conf = pctx->srv_conf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2344 |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2345 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2346 if (ctx->loc_conf == NULL) { |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2347 return NGX_CONF_ERROR; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2348 } |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2349 |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2350 for (i = 0; ngx_modules[i]; i++) { |
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2351 if (ngx_modules[i]->type != NGX_HTTP_MODULE) { |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2352 continue; |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2353 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2354 |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2355 module = ngx_modules[i]->ctx; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2356 |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2357 if (module->create_loc_conf) { |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2358 ctx->loc_conf[ngx_modules[i]->ctx_index] = |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2359 module->create_loc_conf(cf); |
1246
7dda762dcc9a
fix building --without-http_rewrite_module, the bug was introduced in r1236
Igor Sysoev <igor@sysoev.ru>
parents:
1236
diff
changeset
|
2360 if (ctx->loc_conf[ngx_modules[i]->ctx_index] == NULL) { |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2361 return NGX_CONF_ERROR; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2362 } |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2363 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2364 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2365 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
2366 clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2367 clcf->loc_conf = ctx->loc_conf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2368 |
216
f1d0e5f09c1e
nginx-0.0.1-2003-12-25-23:26:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
211
diff
changeset
|
2369 value = cf->args->elts; |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2370 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2371 if (cf->args->nelts == 3) { |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2372 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2373 len = value[1].len; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2374 mod = value[1].data; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2375 name = &value[2]; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2376 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2377 if (len == 1 && mod[0] == '=') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2378 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2379 clcf->name = *name; |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2380 clcf->exact_match = 1; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2381 |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2382 } else if (len == 2 && mod[0] == '^' && mod[1] == '~') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2383 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2384 clcf->name = *name; |
467 | 2385 clcf->noregex = 1; |
2386 | |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2387 } else if (len == 1 && mod[0] == '~') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2388 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2389 if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) { |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2390 return NGX_CONF_ERROR; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2391 } |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2392 |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2393 } else if (len == 2 && mod[0] == '~' && mod[1] == '*') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2394 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2395 if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2396 return NGX_CONF_ERROR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2397 } |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2398 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2399 } else { |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2400 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 2401 "invalid location modifier \"%V\"", &value[1]); |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2402 return NGX_CONF_ERROR; |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2403 } |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2404 |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2405 } else { |
1353 | 2406 |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2407 name = &value[1]; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2408 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2409 if (name->data[0] == '=') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2410 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2411 clcf->name.len = name->len - 1; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2412 clcf->name.data = name->data + 1; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2413 clcf->exact_match = 1; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2414 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2415 } else if (name->data[0] == '^' && name->data[1] == '~') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2416 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2417 clcf->name.len = name->len - 2; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2418 clcf->name.data = name->data + 2; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2419 clcf->noregex = 1; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2420 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2421 } else if (name->data[0] == '~') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2422 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2423 name->len--; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2424 name->data++; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2425 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2426 if (name->data[0] == '*') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2427 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2428 name->len--; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2429 name->data++; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2430 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2431 if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2432 return NGX_CONF_ERROR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2433 } |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2434 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2435 } else { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2436 if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2437 return NGX_CONF_ERROR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2438 } |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2439 } |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2440 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2441 } else { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2442 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2443 clcf->name = *name; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2444 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2445 if (name->data[0] == '@') { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2446 clcf->named = 1; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2447 } |
1353 | 2448 } |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2449 } |
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2450 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2451 pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2452 |
2027 | 2453 if (pclcf->name.len) { |
2454 | |
2455 /* nested location */ | |
2456 | |
485 | 2457 #if 0 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2458 clcf->prev_location = pclcf; |
485 | 2459 #endif |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2460 |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2461 if (pclcf->exact_match) { |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2462 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 2463 "location \"%V\" could not be inside " |
2464 "the exact location \"%V\"", | |
2465 &clcf->name, &pclcf->name); | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2466 return NGX_CONF_ERROR; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2467 } |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2468 |
1353 | 2469 if (pclcf->named) { |
2470 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
2471 "location \"%V\" could not be inside " | |
2472 "the named location \"%V\"", | |
2473 &clcf->name, &pclcf->name); | |
2474 return NGX_CONF_ERROR; | |
2475 } | |
2476 | |
2027 | 2477 if (clcf->named) { |
2478 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
2479 "named location \"%V\" must be " | |
2480 "on server level only", | |
2481 &clcf->name); | |
2482 return NGX_CONF_ERROR; | |
2483 } | |
2484 | |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2485 len = pclcf->name.len; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2486 |
455 | 2487 #if (NGX_PCRE) |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2488 if (clcf->regex == NULL |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2489 && ngx_strncmp(clcf->name.data, pclcf->name.data, len) != 0) |
400
69e851f83522
nginx-0.0.8-2004-07-26-20:21:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
396
diff
changeset
|
2490 #else |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2491 if (ngx_strncmp(clcf->name.data, pclcf->name.data, len) != 0) |
400
69e851f83522
nginx-0.0.8-2004-07-26-20:21:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
396
diff
changeset
|
2492 #endif |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2493 { |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2494 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 2495 "location \"%V\" is outside location \"%V\"", |
2496 &clcf->name, &pclcf->name); | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2497 return NGX_CONF_ERROR; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2498 } |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
2499 } |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
395
diff
changeset
|
2500 |
2027 | 2501 if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { |
2502 return NGX_CONF_ERROR; | |
2503 } | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2504 |
485 | 2505 save = *cf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2506 cf->ctx = ctx; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2507 cf->cmd_type = NGX_HTTP_LOC_CONF; |
485 | 2508 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2509 rv = ngx_conf_parse(cf, NULL); |
485 | 2510 |
2511 *cf = save; | |
2512 | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2513 return rv; |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2514 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2515 |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2516 |
2400
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2517 static ngx_int_t |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2518 ngx_http_core_regex_location(ngx_conf_t *cf, ngx_http_core_loc_conf_t *clcf, |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2519 ngx_str_t *regex, ngx_uint_t caseless) |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2520 { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2521 #if (NGX_PCRE) |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2522 ngx_str_t err; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2523 u_char errstr[NGX_MAX_CONF_ERRSTR]; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2524 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2525 err.len = NGX_MAX_CONF_ERRSTR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2526 err.data = errstr; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2527 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2528 clcf->regex = ngx_regex_compile(regex, caseless ? NGX_REGEX_CASELESS: 0, |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2529 cf->pool, &err); |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2530 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2531 if (clcf->regex == NULL) { |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2532 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data); |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2533 return NGX_ERROR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2534 } |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2535 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2536 clcf->name = *regex; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2537 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2538 return NGX_OK; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2539 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2540 #else |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2541 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2542 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2543 "the using of the regex \"%V\" requires PCRE library", |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2544 regex); |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2545 return NGX_ERROR; |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2546 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2547 #endif |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2548 } |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2549 |
2c2b79633ded
allow "~", "~*", "^~", and "=" before location name without space
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
2550 |
487 | 2551 static char * |
2552 ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2553 { |
637 | 2554 ngx_http_core_loc_conf_t *lcf = conf; |
2555 | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2556 char *rv; |
485 | 2557 ngx_conf_t save; |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2558 |
637 | 2559 if (lcf->types == NULL) { |
2560 lcf->types = ngx_array_create(cf->pool, 64, sizeof(ngx_hash_key_t)); | |
2561 if (lcf->types == NULL) { | |
2562 return NGX_CONF_ERROR; | |
2563 } | |
2564 } | |
2565 | |
485 | 2566 save = *cf; |
2567 cf->handler = ngx_http_core_type; | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2568 cf->handler_conf = conf; |
485 | 2569 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2570 rv = ngx_conf_parse(cf, NULL); |
485 | 2571 |
2572 *cf = save; | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2573 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2574 return rv; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2575 } |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2576 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2577 |
487 | 2578 static char * |
2579 ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2580 { |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2581 ngx_http_core_loc_conf_t *lcf = conf; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2582 |
1149
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2583 ngx_str_t *value, *content_type, *old, file; |
2136 | 2584 ngx_uint_t i, n, hash; |
589 | 2585 ngx_hash_key_t *type; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2586 |
1149
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2587 value = cf->args->elts; |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2588 |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2589 if (ngx_strcmp(value[0].data, "include") == 0) { |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2590 file = value[1]; |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2591 |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
2592 if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { |
1149
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2593 return NGX_CONF_ERROR; |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2594 } |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2595 |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2596 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2597 |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2598 return ngx_conf_parse(cf, &file); |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2599 } |
b8fe8a80e019
the "include" support inside the "types" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1148
diff
changeset
|
2600 |
589 | 2601 content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); |
2602 if (content_type == NULL) { | |
2603 return NGX_CONF_ERROR; | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2604 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2605 |
589 | 2606 *content_type = value[0]; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2607 |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2608 for (i = 1; i < cf->args->nelts; i++) { |
589 | 2609 |
2136 | 2610 hash = ngx_hash_strlow(value[i].data, value[i].data, value[i].len); |
589 | 2611 |
2612 type = lcf->types->elts; | |
2613 for (n = 0; n < lcf->types->nelts; n++) { | |
2614 if (ngx_strcmp(value[i].data, type[n].key.data) == 0) { | |
2615 old = type[n].value; | |
2616 type[n].value = content_type; | |
2617 | |
2618 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
2619 "duplicate extention \"%V\", " | |
2620 "content type: \"%V\", " | |
2621 "old content type: \"%V\"", | |
2622 &value[i], content_type, old); | |
2623 continue; | |
2624 } | |
2625 } | |
2626 | |
2627 | |
2628 type = ngx_array_push(lcf->types); | |
501 | 2629 if (type == NULL) { |
426
3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
425
diff
changeset
|
2630 return NGX_CONF_ERROR; |
3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
425
diff
changeset
|
2631 } |
3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
425
diff
changeset
|
2632 |
589 | 2633 type->key = value[i]; |
2136 | 2634 type->key_hash = hash; |
589 | 2635 type->value = content_type; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2636 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2637 |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2638 return NGX_CONF_OK; |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2639 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2640 |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2641 |
509 | 2642 static ngx_int_t |
2643 ngx_http_core_preconfiguration(ngx_conf_t *cf) | |
2644 { | |
2645 return ngx_http_variables_add_core_vars(cf); | |
2646 } | |
2647 | |
2648 | |
487 | 2649 static void * |
2650 ngx_http_core_create_main_conf(ngx_conf_t *cf) | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2651 { |
485 | 2652 ngx_http_core_main_conf_t *cmcf; |
2653 | |
501 | 2654 cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_main_conf_t)); |
2655 if (cmcf == NULL) { | |
485 | 2656 return NGX_CONF_ERROR; |
2657 } | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2658 |
499 | 2659 if (ngx_array_init(&cmcf->servers, cf->pool, 4, |
569 | 2660 sizeof(ngx_http_core_srv_conf_t *)) |
651 | 2661 != NGX_OK) |
485 | 2662 { |
2663 return NGX_CONF_ERROR; | |
2664 } | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2665 |
593 | 2666 cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT; |
2667 cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT; | |
477 | 2668 |
611 | 2669 cmcf->variables_hash_max_size = NGX_CONF_UNSET_UINT; |
2670 cmcf->variables_hash_bucket_size = NGX_CONF_UNSET_UINT; | |
2671 | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2672 return cmcf; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2673 } |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2674 |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2675 |
487 | 2676 static char * |
2677 ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf) | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2678 { |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
2679 ngx_http_core_main_conf_t *cmcf = conf; |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2680 |
593 | 2681 if (cmcf->server_names_hash_max_size == NGX_CONF_UNSET_UINT) { |
2682 cmcf->server_names_hash_max_size = 512; | |
477 | 2683 } |
2684 | |
593 | 2685 if (cmcf->server_names_hash_bucket_size == NGX_CONF_UNSET_UINT) { |
2686 cmcf->server_names_hash_bucket_size = ngx_cacheline_size; | |
477 | 2687 } |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2688 |
593 | 2689 cmcf->server_names_hash_bucket_size = |
2690 ngx_align(cmcf->server_names_hash_bucket_size, ngx_cacheline_size); | |
2691 | |
611 | 2692 |
2693 if (cmcf->variables_hash_max_size == NGX_CONF_UNSET_UINT) { | |
2694 cmcf->variables_hash_max_size = 512; | |
2695 } | |
2696 | |
2697 if (cmcf->variables_hash_bucket_size == NGX_CONF_UNSET_UINT) { | |
2698 cmcf->variables_hash_bucket_size = 64; | |
2699 } | |
2700 | |
2701 cmcf->variables_hash_bucket_size = | |
2702 ngx_align(cmcf->variables_hash_bucket_size, ngx_cacheline_size); | |
2703 | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2704 return NGX_CONF_OK; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2705 } |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2706 |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2707 |
487 | 2708 static void * |
2709 ngx_http_core_create_srv_conf(ngx_conf_t *cf) | |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2710 { |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2711 ngx_http_core_srv_conf_t *cscf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2712 |
501 | 2713 cscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_srv_conf_t)); |
2714 if (cscf == NULL) { | |
487 | 2715 return NGX_CONF_ERROR; |
2716 } | |
2717 | |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
434
diff
changeset
|
2718 /* |
487 | 2719 * set by ngx_pcalloc(): |
479 | 2720 * |
2721 * conf->client_large_buffers.num = 0; | |
2722 */ | |
435
5cdc4838d4e8
nginx-0.0.11-2004-09-22-20:18:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
434
diff
changeset
|
2723 |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2724 if (ngx_array_init(&cscf->listen, cf->temp_pool, 4, |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2725 sizeof(ngx_http_listen_t)) |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
2726 != NGX_OK) |
487 | 2727 { |
2728 return NGX_CONF_ERROR; | |
2729 } | |
2730 | |
681 | 2731 if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4, |
593 | 2732 sizeof(ngx_http_server_name_t)) |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
2733 != NGX_OK) |
487 | 2734 { |
2735 return NGX_CONF_ERROR; | |
2736 } | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2737 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2738 cscf->connection_pool_size = NGX_CONF_UNSET_SIZE; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2739 cscf->request_pool_size = NGX_CONF_UNSET_SIZE; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2740 cscf->client_header_timeout = NGX_CONF_UNSET_MSEC; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2741 cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE; |
511 | 2742 cscf->ignore_invalid_headers = NGX_CONF_UNSET; |
1585 | 2743 cscf->merge_slashes = NGX_CONF_UNSET; |
2256 | 2744 cscf->underscores_in_headers = NGX_CONF_UNSET; |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2745 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2746 return cscf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2747 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2748 |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2749 |
487 | 2750 static char * |
2751 ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2752 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2753 ngx_http_core_srv_conf_t *prev = parent; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2754 ngx_http_core_srv_conf_t *conf = child; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2755 |
593 | 2756 ngx_http_listen_t *ls; |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2757 struct sockaddr_in *sin; |
593 | 2758 ngx_http_server_name_t *sn; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
2759 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
2760 /* TODO: it does not merge, it inits only */ |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2761 |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
2762 if (conf->listen.nelts == 0) { |
501 | 2763 ls = ngx_array_push(&conf->listen); |
2764 if (ls == NULL) { | |
487 | 2765 return NGX_CONF_ERROR; |
2766 } | |
2767 | |
523 | 2768 ngx_memzero(ls, sizeof(ngx_http_listen_t)); |
2769 | |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2770 sin = (struct sockaddr_in *) &ls->sockaddr; |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2771 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2772 sin->sin_family = AF_INET; |
461 | 2773 #if (NGX_WIN32) |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2774 sin->sin_port = htons(80); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
2775 #else |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2776 sin->sin_port = htons((getuid() == 0) ? 80 : 8000); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
2777 #endif |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
2778 sin->sin_addr.s_addr = INADDR_ANY; |
569 | 2779 |
2516
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2780 ls->socklen = sizeof(struct sockaddr_in); |
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2781 |
1377
0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
Igor Sysoev <igor@sysoev.ru>
parents:
1353
diff
changeset
|
2782 ls->conf.backlog = NGX_LISTEN_BACKLOG; |
569 | 2783 ls->conf.rcvbuf = -1; |
2784 ls->conf.sndbuf = -1; | |
2516
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2785 ls->conf.wildcard = 1; |
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2786 |
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2787 (void) ngx_sock_ntop((struct sockaddr *) &ls->sockaddr, ls->conf.addr, |
52ce03b3ad18
fix implicit listen, introduced in r2513
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
2788 NGX_SOCKADDR_STRLEN, 1); |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2789 } |
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2790 |
605 | 2791 if (conf->server_name.data == NULL) { |
2011 | 2792 conf->server_name = cf->cycle->hostname; |
605 | 2793 |
501 | 2794 sn = ngx_array_push(&conf->server_names); |
2795 if (sn == NULL) { | |
487 | 2796 return NGX_CONF_ERROR; |
2797 } | |
2798 | |
1580
c9a0f82deb7c
fix segfault if no server_name was defined
Igor Sysoev <igor@sysoev.ru>
parents:
1559
diff
changeset
|
2799 #if (NGX_PCRE) |
c9a0f82deb7c
fix segfault if no server_name was defined
Igor Sysoev <igor@sysoev.ru>
parents:
1559
diff
changeset
|
2800 sn->regex = NULL; |
c9a0f82deb7c
fix segfault if no server_name was defined
Igor Sysoev <igor@sysoev.ru>
parents:
1559
diff
changeset
|
2801 #endif |
c9a0f82deb7c
fix segfault if no server_name was defined
Igor Sysoev <igor@sysoev.ru>
parents:
1559
diff
changeset
|
2802 sn->core_srv_conf = conf; |
605 | 2803 sn->name.len = conf->server_name.len; |
2804 sn->name.data = conf->server_name.data; | |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
46
diff
changeset
|
2805 } |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
46
diff
changeset
|
2806 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
2807 ngx_conf_merge_size_value(conf->connection_pool_size, |
448
241dc8092a33
nginx-0.1.0-2004-10-01-19:53:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
2808 prev->connection_pool_size, 256); |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2809 ngx_conf_merge_size_value(conf->request_pool_size, |
448
241dc8092a33
nginx-0.1.0-2004-10-01-19:53:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
2810 prev->request_pool_size, 4096); |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2811 ngx_conf_merge_msec_value(conf->client_header_timeout, |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2812 prev->client_header_timeout, 60000); |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2813 ngx_conf_merge_size_value(conf->client_header_buffer_size, |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
2814 prev->client_header_buffer_size, 1024); |
436
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2815 ngx_conf_merge_bufs_value(conf->large_client_header_buffers, |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2816 prev->large_client_header_buffers, |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2817 4, ngx_pagesize); |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2818 |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2819 if (conf->large_client_header_buffers.size < conf->connection_pool_size) { |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2820 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2821 "the \"large_client_header_buffers\" size must be " |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2822 "equal to or bigger than \"connection_pool_size\""); |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2823 return NGX_CONF_ERROR; |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2824 } |
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
435
diff
changeset
|
2825 |
511 | 2826 ngx_conf_merge_value(conf->ignore_invalid_headers, |
2827 prev->ignore_invalid_headers, 1); | |
2828 | |
1585 | 2829 ngx_conf_merge_value(conf->merge_slashes, prev->merge_slashes, 1); |
2830 | |
2256 | 2831 ngx_conf_merge_value(conf->underscores_in_headers, |
2832 prev->underscores_in_headers, 0); | |
2833 | |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2834 return NGX_CONF_OK; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
2835 } |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
2836 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2837 |
487 | 2838 static void * |
2839 ngx_http_core_create_loc_conf(ngx_conf_t *cf) | |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
2840 { |
485 | 2841 ngx_http_core_loc_conf_t *lcf; |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2842 |
501 | 2843 lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_loc_conf_t)); |
2844 if (lcf == NULL) { | |
487 | 2845 return NGX_CONF_ERROR; |
2846 } | |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
13
diff
changeset
|
2847 |
479 | 2848 /* |
2849 * set by ngx_pcalloc(): | |
2850 * | |
577 | 2851 * lcf->root = { 0, NULL }; |
631 | 2852 * lcf->limit_except = 0; |
577 | 2853 * lcf->post_action = { 0, NULL }; |
479 | 2854 * lcf->types = NULL; |
577 | 2855 * lcf->default_type = { 0, NULL }; |
479 | 2856 * lcf->err_log = NULL; |
2857 * lcf->error_pages = NULL; | |
2407 | 2858 * lcf->try_files = NULL; |
479 | 2859 * lcf->client_body_path = NULL; |
2860 * lcf->regex = NULL; | |
2861 * lcf->exact_match = 0; | |
2862 * lcf->auto_redirect = 0; | |
2863 * lcf->alias = 0; | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2864 * lcf->gzip_proxied = 0; |
479 | 2865 */ |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2866 |
663 | 2867 lcf->client_max_body_size = NGX_CONF_UNSET; |
303
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
2868 lcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2869 lcf->client_body_timeout = NGX_CONF_UNSET_MSEC; |
1809
1f8c13eb04b6
fix building by msvc introduced by r1807
Igor Sysoev <igor@sysoev.ru>
parents:
1808
diff
changeset
|
2870 lcf->satisfy = NGX_CONF_UNSET_UINT; |
2361 | 2871 lcf->if_modified_since = NGX_CONF_UNSET_UINT; |
509 | 2872 lcf->internal = NGX_CONF_UNSET; |
633 | 2873 lcf->client_body_in_file_only = NGX_CONF_UNSET; |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
2874 lcf->sendfile = NGX_CONF_UNSET; |
1197 | 2875 lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE; |
2129 | 2876 lcf->directio = NGX_CONF_UNSET; |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
2877 lcf->tcp_nopush = NGX_CONF_UNSET; |
452 | 2878 lcf->tcp_nodelay = NGX_CONF_UNSET; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2879 lcf->send_timeout = NGX_CONF_UNSET_MSEC; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2880 lcf->send_lowat = NGX_CONF_UNSET_SIZE; |
391
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
2881 lcf->postpone_output = NGX_CONF_UNSET_SIZE; |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
2882 lcf->limit_rate = NGX_CONF_UNSET_SIZE; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2883 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC; |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
2884 lcf->keepalive_header = NGX_CONF_UNSET; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2885 lcf->lingering_time = NGX_CONF_UNSET_MSEC; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
2886 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC; |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
2887 lcf->resolver_timeout = NGX_CONF_UNSET_MSEC; |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
2888 lcf->reset_timedout_connection = NGX_CONF_UNSET; |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
2889 lcf->server_name_in_redirect = NGX_CONF_UNSET; |
521 | 2890 lcf->port_in_redirect = NGX_CONF_UNSET; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
2891 lcf->msie_padding = NGX_CONF_UNSET; |
679 | 2892 lcf->msie_refresh = NGX_CONF_UNSET; |
527 | 2893 lcf->log_not_found = NGX_CONF_UNSET; |
2261 | 2894 lcf->log_subrequest = NGX_CONF_UNSET; |
679 | 2895 lcf->recursive_error_pages = NGX_CONF_UNSET; |
1592 | 2896 lcf->server_tokens = NGX_CONF_UNSET; |
589 | 2897 lcf->types_hash_max_size = NGX_CONF_UNSET_UINT; |
2898 lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT; | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2899 |
1454 | 2900 lcf->open_file_cache = NGX_CONF_UNSET_PTR; |
1767
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
2901 lcf->open_file_cache_valid = NGX_CONF_UNSET; |
1772 | 2902 lcf->open_file_cache_min_uses = NGX_CONF_UNSET_UINT; |
1454 | 2903 lcf->open_file_cache_errors = NGX_CONF_UNSET; |
1457 | 2904 lcf->open_file_cache_events = NGX_CONF_UNSET; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
2905 |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2906 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2907 lcf->gzip_vary = NGX_CONF_UNSET; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2908 lcf->gzip_http_version = NGX_CONF_UNSET_UINT; |
1800 | 2909 #if (NGX_PCRE) |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2910 lcf->gzip_disable = NGX_CONF_UNSET_PTR; |
2205 | 2911 lcf->gzip_disable_msie6 = 3; |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2912 #endif |
1800 | 2913 #endif |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
2914 |
44
0e81ac0bb3e2
nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
43
diff
changeset
|
2915 return lcf; |
13
2aba961a1d34
nginx-0.0.1-2002-09-16-19:01:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2916 } |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
2917 |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2918 |
589 | 2919 static ngx_str_t ngx_http_core_text_html_type = ngx_string("text/html"); |
2920 static ngx_str_t ngx_http_core_image_gif_type = ngx_string("image/gif"); | |
2921 static ngx_str_t ngx_http_core_image_jpeg_type = ngx_string("image/jpeg"); | |
2922 | |
2923 static ngx_hash_key_t ngx_http_core_default_types[] = { | |
2924 { ngx_string("html"), 0, &ngx_http_core_text_html_type }, | |
2925 { ngx_string("gif"), 0, &ngx_http_core_image_gif_type }, | |
2926 { ngx_string("jpg"), 0, &ngx_http_core_image_jpeg_type }, | |
2927 { ngx_null_string, 0, NULL } | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2928 }; |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2929 |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2930 |
487 | 2931 static char * |
589 | 2932 ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |
71
59229033ae93
nginx-0.0.1-2003-04-08-19:40:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
69
diff
changeset
|
2933 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2934 ngx_http_core_loc_conf_t *prev = parent; |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
2935 ngx_http_core_loc_conf_t *conf = child; |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2936 |
487 | 2937 ngx_uint_t i; |
589 | 2938 ngx_hash_key_t *type; |
2939 ngx_hash_init_t types_hash; | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2940 |
603 | 2941 if (conf->root.data == NULL) { |
2942 | |
625 | 2943 conf->alias = prev->alias; |
603 | 2944 conf->root = prev->root; |
2945 conf->root_lengths = prev->root_lengths; | |
2946 conf->root_values = prev->root_values; | |
2947 | |
2948 if (prev->root.data == NULL) { | |
2949 conf->root.len = sizeof("html") - 1; | |
2950 conf->root.data = (u_char *) "html"; | |
2951 | |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
2952 if (ngx_conf_full_name(cf->cycle, &conf->root, 0) != NGX_OK) { |
603 | 2953 return NGX_CONF_ERROR; |
2954 } | |
2955 } | |
440
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
439
diff
changeset
|
2956 } |
f390d1775430
nginx-0.1.0-2004-09-27-20:03:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
439
diff
changeset
|
2957 |
577 | 2958 if (conf->post_action.data == NULL) { |
2959 conf->post_action = prev->post_action; | |
2960 } | |
2961 | |
663 | 2962 ngx_conf_merge_uint_value(conf->types_hash_max_size, |
2963 prev->types_hash_max_size, 1024); | |
2964 | |
2965 ngx_conf_merge_uint_value(conf->types_hash_bucket_size, | |
2966 prev->types_hash_bucket_size, | |
2967 ngx_cacheline_size); | |
589 | 2968 |
2969 conf->types_hash_bucket_size = ngx_align(conf->types_hash_bucket_size, | |
2970 ngx_cacheline_size); | |
2971 | |
2972 /* | |
2973 * the special handling the "types" directive in the "http" section | |
2974 * to inherit the http's conf->types_hash to all servers | |
2975 */ | |
2976 | |
2977 if (prev->types && prev->types_hash.buckets == NULL) { | |
2978 | |
2979 types_hash.hash = &prev->types_hash; | |
2980 types_hash.key = ngx_hash_key_lc; | |
2981 types_hash.max_size = conf->types_hash_max_size; | |
2982 types_hash.bucket_size = conf->types_hash_bucket_size; | |
595 | 2983 types_hash.name = "types_hash"; |
589 | 2984 types_hash.pool = cf->pool; |
2985 types_hash.temp_pool = NULL; | |
2986 | |
2987 if (ngx_hash_init(&types_hash, prev->types->elts, prev->types->nelts) | |
2988 != NGX_OK) | |
2989 { | |
2990 return NGX_CONF_ERROR; | |
2991 } | |
2992 } | |
2993 | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
2994 if (conf->types == NULL) { |
589 | 2995 conf->types = prev->types; |
2996 conf->types_hash = prev->types_hash; | |
2997 } | |
2998 | |
2999 if (conf->types == NULL) { | |
3000 conf->types = ngx_array_create(cf->pool, 4, sizeof(ngx_hash_key_t)); | |
3001 if (conf->types == NULL) { | |
3002 return NGX_CONF_ERROR; | |
3003 } | |
3004 | |
3005 for (i = 0; ngx_http_core_default_types[i].key.len; i++) { | |
3006 type = ngx_array_push(conf->types); | |
3007 if (type == NULL) { | |
487 | 3008 return NGX_CONF_ERROR; |
3009 } | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3010 |
589 | 3011 type->key = ngx_http_core_default_types[i].key; |
3012 type->key_hash = | |
3013 ngx_hash_key_lc(ngx_http_core_default_types[i].key.data, | |
3014 ngx_http_core_default_types[i].key.len); | |
3015 type->value = ngx_http_core_default_types[i].value; | |
3016 } | |
3017 } | |
3018 | |
3019 if (conf->types_hash.buckets == NULL) { | |
3020 | |
3021 types_hash.hash = &conf->types_hash; | |
3022 types_hash.key = ngx_hash_key_lc; | |
3023 types_hash.max_size = conf->types_hash_max_size; | |
3024 types_hash.bucket_size = conf->types_hash_bucket_size; | |
595 | 3025 types_hash.name = "mime_types_hash"; |
589 | 3026 types_hash.pool = cf->pool; |
3027 types_hash.temp_pool = NULL; | |
3028 | |
3029 if (ngx_hash_init(&types_hash, conf->types->elts, conf->types->nelts) | |
3030 != NGX_OK) | |
3031 { | |
3032 return NGX_CONF_ERROR; | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3033 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3034 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3035 |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3036 if (conf->err_log == NULL) { |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3037 if (prev->err_log) { |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3038 conf->err_log = prev->err_log; |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3039 } else { |
318
56496082668b
nginx-0.0.3-2004-04-16-09:14:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
3040 conf->err_log = cf->cycle->new_log; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3041 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3042 } |
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
118
diff
changeset
|
3043 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3044 if (conf->error_pages == NULL && prev->error_pages) { |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3045 conf->error_pages = prev->error_pages; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3046 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3047 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
3048 ngx_conf_merge_str_value(conf->default_type, |
487 | 3049 prev->default_type, "text/plain"); |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
95
diff
changeset
|
3050 |
663 | 3051 ngx_conf_merge_off_value(conf->client_max_body_size, |
448
241dc8092a33
nginx-0.1.0-2004-10-01-19:53:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
3052 prev->client_max_body_size, 1 * 1024 * 1024); |
303
00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
300
diff
changeset
|
3053 ngx_conf_merge_size_value(conf->client_body_buffer_size, |
448
241dc8092a33
nginx-0.1.0-2004-10-01-19:53:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
3054 prev->client_body_buffer_size, |
241dc8092a33
nginx-0.1.0-2004-10-01-19:53:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
3055 (size_t) 2 * ngx_pagesize); |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
160
diff
changeset
|
3056 ngx_conf_merge_msec_value(conf->client_body_timeout, |
253
b6793bc5034b
nginx-0.0.2-2004-02-09-10:46:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
234
diff
changeset
|
3057 prev->client_body_timeout, 60000); |
509 | 3058 |
1806 | 3059 ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy, |
3060 NGX_HTTP_SATISFY_ALL); | |
2361 | 3061 ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since, |
2496 | 3062 NGX_HTTP_IMS_EXACT); |
509 | 3063 ngx_conf_merge_value(conf->internal, prev->internal, 0); |
633 | 3064 ngx_conf_merge_value(conf->client_body_in_file_only, |
3065 prev->client_body_in_file_only, 0); | |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
3066 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); |
1197 | 3067 ngx_conf_merge_size_value(conf->sendfile_max_chunk, |
3068 prev->sendfile_max_chunk, 0); | |
2129 | 3069 ngx_conf_merge_off_value(conf->directio, prev->directio, |
3070 NGX_MAX_OFF_T_VALUE); | |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
3071 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); |
679 | 3072 ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1); |
509 | 3073 |
253
b6793bc5034b
nginx-0.0.2-2004-02-09-10:46:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
234
diff
changeset
|
3074 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
3075 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0); |
391
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
3076 ngx_conf_merge_size_value(conf->postpone_output, prev->postpone_output, |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
3077 1460); |
b670db10cbbd
nginx-0.0.7-2004-07-14-20:01:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
381
diff
changeset
|
3078 ngx_conf_merge_size_value(conf->limit_rate, prev->limit_rate, 0); |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
3079 ngx_conf_merge_msec_value(conf->keepalive_timeout, |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3080 prev->keepalive_timeout, 75000); |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3081 ngx_conf_merge_sec_value(conf->keepalive_header, |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3082 prev->keepalive_header, 0); |
95
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
3083 ngx_conf_merge_msec_value(conf->lingering_time, |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
3084 prev->lingering_time, 30000); |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
3085 ngx_conf_merge_msec_value(conf->lingering_timeout, |
b48066122884
nginx-0.0.1-2003-05-23-15:53:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
94
diff
changeset
|
3086 prev->lingering_timeout, 5000); |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
3087 ngx_conf_merge_msec_value(conf->resolver_timeout, |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
3088 prev->resolver_timeout, 30000); |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
3089 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
3090 if (conf->resolver == NULL) { |
1919
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3091 |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3092 if (prev->resolver == NULL) { |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3093 |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3094 /* |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3095 * create dummy resolver in http {} context |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3096 * to inherit it in all servers |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3097 */ |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3098 |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3099 prev->resolver = ngx_resolver_create(cf, NULL); |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3100 if (prev->resolver == NULL) { |
1881 | 3101 return NGX_CONF_ERROR; |
1683
1e0b028055ec
allow to use IP addresses without defined resolver
Igor Sysoev <igor@sysoev.ru>
parents:
1675
diff
changeset
|
3102 } |
1e0b028055ec
allow to use IP addresses without defined resolver
Igor Sysoev <igor@sysoev.ru>
parents:
1675
diff
changeset
|
3103 } |
2006
b52cb9bf2064
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
1982
diff
changeset
|
3104 |
1919
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
3105 conf->resolver = prev->resolver; |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
3106 } |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3107 |
479 | 3108 ngx_conf_merge_path_value(conf->client_body_temp_path, |
3109 prev->client_body_temp_path, | |
3110 NGX_HTTP_CLIENT_TEMP_PATH, 0, 0, 0, | |
3111 ngx_garbage_collector_temp_handler, cf); | |
3112 | |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
344
diff
changeset
|
3113 ngx_conf_merge_value(conf->reset_timedout_connection, |
487 | 3114 prev->reset_timedout_connection, 0); |
1804
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
3115 ngx_conf_merge_value(conf->server_name_in_redirect, |
d457a1576532
several changes in server_name:
Igor Sysoev <igor@sysoev.ru>
parents:
1801
diff
changeset
|
3116 prev->server_name_in_redirect, 1); |
521 | 3117 ngx_conf_merge_value(conf->port_in_redirect, prev->port_in_redirect, 1); |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
3118 ngx_conf_merge_value(conf->msie_padding, prev->msie_padding, 1); |
679 | 3119 ngx_conf_merge_value(conf->msie_refresh, prev->msie_refresh, 0); |
527 | 3120 ngx_conf_merge_value(conf->log_not_found, prev->log_not_found, 1); |
2261 | 3121 ngx_conf_merge_value(conf->log_subrequest, prev->log_subrequest, 0); |
679 | 3122 ngx_conf_merge_value(conf->recursive_error_pages, |
3123 prev->recursive_error_pages, 0); | |
1592 | 3124 ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1); |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
3125 |
1454 | 3126 ngx_conf_merge_ptr_value(conf->open_file_cache, |
1780 | 3127 prev->open_file_cache, NULL); |
1454 | 3128 |
1767
c42431762903
open_file_cache_retest > open_file_cache_valid
Igor Sysoev <igor@sysoev.ru>
parents:
1704
diff
changeset
|
3129 ngx_conf_merge_sec_value(conf->open_file_cache_valid, |
1780 | 3130 prev->open_file_cache_valid, 60); |
1454 | 3131 |
1772 | 3132 ngx_conf_merge_uint_value(conf->open_file_cache_min_uses, |
1780 | 3133 prev->open_file_cache_min_uses, 1); |
1772 | 3134 |
1454 | 3135 ngx_conf_merge_sec_value(conf->open_file_cache_errors, |
1780 | 3136 prev->open_file_cache_errors, 0); |
201
267ea1d98683
nginx-0.0.1-2003-11-30-23:03:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
3137 |
1457 | 3138 ngx_conf_merge_sec_value(conf->open_file_cache_events, |
1780 | 3139 prev->open_file_cache_events, 0); |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3140 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3141 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3142 ngx_conf_merge_value(conf->gzip_vary, prev->gzip_vary, 0); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3143 ngx_conf_merge_uint_value(conf->gzip_http_version, prev->gzip_http_version, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3144 NGX_HTTP_VERSION_11); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3145 ngx_conf_merge_bitmask_value(conf->gzip_proxied, prev->gzip_proxied, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3146 (NGX_CONF_BITMASK_SET|NGX_HTTP_GZIP_PROXIED_OFF)); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3147 |
1800 | 3148 #if (NGX_PCRE) |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3149 ngx_conf_merge_ptr_value(conf->gzip_disable, prev->gzip_disable, NULL); |
1800 | 3150 #endif |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3151 |
2205 | 3152 if (conf->gzip_disable_msie6 == 3) { |
3153 conf->gzip_disable_msie6 = | |
3154 (prev->gzip_disable_msie6 == 3) ? 0 : prev->gzip_disable_msie6; | |
3155 } | |
3156 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
3157 #endif |
1457 | 3158 |
71
59229033ae93
nginx-0.0.1-2003-04-08-19:40:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
69
diff
changeset
|
3159 return NGX_CONF_OK; |
59229033ae93
nginx-0.0.1-2003-04-08-19:40:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
69
diff
changeset
|
3160 } |
59229033ae93
nginx-0.0.1-2003-04-08-19:40:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
69
diff
changeset
|
3161 |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
3162 |
487 | 3163 static char * |
3164 ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3165 { |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
3166 ngx_http_core_srv_conf_t *scf = conf; |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
90
diff
changeset
|
3167 |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3168 ngx_str_t *value, size; |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3169 ngx_url_t u; |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3170 ngx_uint_t n; |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3171 ngx_http_listen_t *ls; |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3172 |
425
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3173 /* |
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3174 * TODO: check duplicate 'listen' directives, |
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3175 * add resolved name to server names ??? |
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3176 */ |
89
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
3177 |
523 | 3178 value = cf->args->elts; |
577 | 3179 |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3180 ngx_memzero(&u, sizeof(ngx_url_t)); |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3181 |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3182 u.url = value[1]; |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3183 u.listen = 1; |
906 | 3184 u.default_port = 80; |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3185 |
1559
fe11e2a3946d
use pool instead of ngx_conf_t
Igor Sysoev <igor@sysoev.ru>
parents:
1546
diff
changeset
|
3186 if (ngx_parse_url(cf->pool, &u) != NGX_OK) { |
804
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3187 if (u.err) { |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3188 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3189 "%s in \"%V\" of the \"listen\" directive", |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3190 u.err, &u.url); |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3191 } |
472cd9768ac2
now the "listen" directives use ngx_parse_url()
Igor Sysoev <igor@sysoev.ru>
parents:
777
diff
changeset
|
3192 |
577 | 3193 return NGX_CONF_ERROR; |
523 | 3194 } |
3195 | |
501 | 3196 ls = ngx_array_push(&scf->listen); |
3197 if (ls == NULL) { | |
425
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3198 return NGX_CONF_ERROR; |
bd39260a1383
nginx-0.0.10-2004-09-14-19:55:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
3199 } |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3200 |
523 | 3201 ngx_memzero(ls, sizeof(ngx_http_listen_t)); |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3202 |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3203 ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen); |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3204 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3205 ls->socklen = u.socklen; |
1489
56f1ea5baabb
u_char* is enough to keep file name
Igor Sysoev <igor@sysoev.ru>
parents:
1457
diff
changeset
|
3206 ls->file_name = cf->conf_file->file.name.data; |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3207 ls->line = cf->conf_file->line; |
1377
0d57c150115b
set default listen() backlog to 511 on all platforms except FreeBSD
Igor Sysoev <igor@sysoev.ru>
parents:
1353
diff
changeset
|
3208 ls->conf.backlog = NGX_LISTEN_BACKLOG; |
563 | 3209 ls->conf.rcvbuf = -1; |
3210 ls->conf.sndbuf = -1; | |
2512
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3211 ls->conf.wildcard = u.wildcard; |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3212 |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3213 (void) ngx_sock_ntop((struct sockaddr *) &ls->sockaddr, ls->conf.addr, |
2e91aecb9e57
a prelimiary IPv6 support, HTTP listen
Igor Sysoev <igor@sysoev.ru>
parents:
2503
diff
changeset
|
3214 NGX_SOCKADDR_STRLEN, 1); |
631 | 3215 |
523 | 3216 if (cf->args->nelts == 2) { |
3217 return NGX_CONF_OK; | |
3218 } | |
3219 | |
3220 if (ngx_strcmp(value[2].data, "default") == 0) { | |
3221 ls->conf.default_server = 1; | |
3222 n = 3; | |
589 | 3223 |
523 | 3224 } else { |
3225 n = 2; | |
89
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
3226 } |
29bf798b583f
nginx-0.0.1-2003-05-15-19:42:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
3227 |
523 | 3228 for ( /* void */ ; n < cf->args->nelts; n++) { |
3229 | |
3230 if (ls->conf.default_server == 0) { | |
3231 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3232 "\"%V\" parameter can be specified for " | |
3233 "the default \"listen\" directive only", | |
3234 &value[n]); | |
3235 return NGX_CONF_ERROR; | |
3236 } | |
3237 | |
3238 if (ngx_strcmp(value[n].data, "bind") == 0) { | |
3239 ls->conf.bind = 1; | |
3240 continue; | |
3241 } | |
3242 | |
563 | 3243 if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) { |
3244 ls->conf.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8); | |
523 | 3245 ls->conf.bind = 1; |
3246 | |
3247 if (ls->conf.backlog == NGX_ERROR || ls->conf.backlog == 0) { | |
3248 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3249 "invalid backlog \"%V\"", &value[n]); | |
3250 return NGX_CONF_ERROR; | |
3251 } | |
3252 | |
3253 continue; | |
3254 } | |
3255 | |
563 | 3256 if (ngx_strncmp(value[n].data, "rcvbuf=", 7) == 0) { |
3257 size.len = value[n].len - 7; | |
3258 size.data = value[n].data + 7; | |
3259 | |
3260 ls->conf.rcvbuf = ngx_parse_size(&size); | |
3261 ls->conf.bind = 1; | |
3262 | |
3263 if (ls->conf.rcvbuf == NGX_ERROR) { | |
3264 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3265 "invalid rcvbuf \"%V\"", &value[n]); | |
3266 return NGX_CONF_ERROR; | |
3267 } | |
3268 | |
3269 continue; | |
3270 } | |
3271 | |
3272 if (ngx_strncmp(value[n].data, "sndbuf=", 7) == 0) { | |
3273 size.len = value[n].len - 7; | |
3274 size.data = value[n].data + 7; | |
3275 | |
3276 ls->conf.sndbuf = ngx_parse_size(&size); | |
3277 ls->conf.bind = 1; | |
3278 | |
3279 if (ls->conf.sndbuf == NGX_ERROR) { | |
3280 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3281 "invalid sndbuf \"%V\"", &value[n]); | |
3282 return NGX_CONF_ERROR; | |
3283 } | |
3284 | |
3285 continue; | |
3286 } | |
3287 | |
3288 if (ngx_strncmp(value[n].data, "accept_filter=", 14) == 0) { | |
523 | 3289 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) |
563 | 3290 ls->conf.accept_filter = (char *) &value[n].data[14]; |
523 | 3291 ls->conf.bind = 1; |
3292 #else | |
3293 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3294 "accept filters \"%V\" are not supported " | |
3295 "on this platform, ignored", | |
3296 &value[n]); | |
3297 #endif | |
3298 continue; | |
3299 } | |
3300 | |
3301 if (ngx_strcmp(value[n].data, "deferred") == 0) { | |
3302 #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) | |
3303 ls->conf.deferred_accept = 1; | |
3304 ls->conf.bind = 1; | |
3305 #else | |
3306 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3307 "the deferred accept is not supported " | |
3308 "on this platform, ignored"); | |
3309 #endif | |
3310 continue; | |
3311 } | |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3312 |
2224 | 3313 if (ngx_strcmp(value[n].data, "ssl") == 0) { |
3314 #if (NGX_HTTP_SSL) | |
3315 ls->conf.ssl = 1; | |
3316 continue; | |
3317 #else | |
3318 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3319 "the \"ssl\" parameter requires " | |
3320 "ngx_http_ssl_module"); | |
3321 return NGX_CONF_ERROR; | |
3322 #endif | |
3323 } | |
3324 | |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
3325 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
523 | 3326 "the invalid \"%V\" parameter", &value[n]); |
118
5bf52498665c
nginx-0.0.1-2003-07-18-18:44:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
115
diff
changeset
|
3327 return NGX_CONF_ERROR; |
54
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3328 } |
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3329 |
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3330 return NGX_CONF_OK; |
27b628ef907e
nginx-0.0.1-2003-01-28-18:56:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
3331 } |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3332 |
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3333 |
487 | 3334 static char * |
3335 ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3336 { |
593 | 3337 ngx_http_core_srv_conf_t *cscf = conf; |
3338 | |
3339 u_char ch; | |
3340 ngx_str_t *value, name; | |
3341 ngx_uint_t i; | |
3342 ngx_http_server_name_t *sn; | |
369
9c2515d70489
nginx-0.0.7-2004-06-25-18:42:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
3343 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
3344 value = cf->args->elts; |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3345 |
593 | 3346 ch = value[1].data[0]; |
3347 | |
2195 | 3348 if (cscf->server_name.data == NULL) { |
3349 if (value[1].len) { | |
3350 name = value[1]; | |
3351 | |
3352 if (ch == '.') { | |
3353 name.len--; | |
3354 name.data++; | |
3355 } | |
3356 | |
3357 cscf->server_name.len = name.len; | |
3358 cscf->server_name.data = ngx_pstrdup(cf->pool, &name); | |
3359 if (cscf->server_name.data == NULL) { | |
3360 return NGX_CONF_ERROR; | |
3361 } | |
3362 | |
3363 } else { | |
3364 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3365 "the first server name must not be empty"); | |
593 | 3366 return NGX_CONF_ERROR; |
3367 } | |
3368 } | |
3369 | |
3370 for (i = 1; i < cf->args->nelts; i++) { | |
3371 | |
3372 ch = value[i].data[0]; | |
3373 | |
2195 | 3374 if ((ch == '*' && (value[i].len < 3 || value[i].data[1] != '.')) |
593 | 3375 || (ch == '.' && value[i].len < 2)) |
3376 { | |
3377 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3378 "server name \"%V\" is invalid", &value[i]); | |
3379 return NGX_CONF_ERROR; | |
3380 } | |
3381 | |
1157 | 3382 if (ngx_strchr(value[i].data, '/')) { |
3383 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
3384 "server name \"%V\" has strange symbols", | |
3385 &value[i]); | |
3386 } | |
3387 | |
1808 | 3388 if (value[i].len == 1 && ch == '*') { |
3389 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3390 "\"server_name *\" is unsupported, use " | |
3391 "\"server_name_in_redirect off\" instead"); | |
3392 return NGX_CONF_ERROR; | |
3393 } | |
3394 | |
593 | 3395 sn = ngx_array_push(&cscf->server_names); |
501 | 3396 if (sn == NULL) { |
455 | 3397 return NGX_CONF_ERROR; |
3398 } | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
3399 |
1387 | 3400 #if (NGX_PCRE) |
3401 sn->regex = NULL; | |
3402 #endif | |
3403 sn->core_srv_conf = cscf; | |
1781 | 3404 sn->name = value[i]; |
1387 | 3405 |
3406 if (value[i].data[0] != '~') { | |
3407 continue; | |
3408 } | |
3409 | |
3410 #if (NGX_PCRE) | |
1704
e584e946e198
move condition declarations inside blocks where they are used
Igor Sysoev <igor@sysoev.ru>
parents:
1683
diff
changeset
|
3411 { |
e584e946e198
move condition declarations inside blocks where they are used
Igor Sysoev <igor@sysoev.ru>
parents:
1683
diff
changeset
|
3412 ngx_str_t err; |
e584e946e198
move condition declarations inside blocks where they are used
Igor Sysoev <igor@sysoev.ru>
parents:
1683
diff
changeset
|
3413 u_char errstr[NGX_MAX_CONF_ERRSTR]; |
e584e946e198
move condition declarations inside blocks where they are used
Igor Sysoev <igor@sysoev.ru>
parents:
1683
diff
changeset
|
3414 |
1387 | 3415 err.len = NGX_MAX_CONF_ERRSTR; |
3416 err.data = errstr; | |
3417 | |
3418 value[i].len--; | |
3419 value[i].data++; | |
3420 | |
2007
b9de93d804ea
*) host in request line has priority
Igor Sysoev <igor@sysoev.ru>
parents:
2006
diff
changeset
|
3421 sn->regex = ngx_regex_compile(&value[i], 0, cf->pool, &err); |
1387 | 3422 |
3423 if (sn->regex == NULL) { | |
3424 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data); | |
3425 return NGX_CONF_ERROR; | |
3426 } | |
3427 | |
1781 | 3428 sn->name = value[i]; |
1704
e584e946e198
move condition declarations inside blocks where they are used
Igor Sysoev <igor@sysoev.ru>
parents:
1683
diff
changeset
|
3429 } |
1387 | 3430 #else |
3431 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3432 "the using of the regex \"%V\" " | |
3433 "requires PCRE library", &value[i]); | |
3434 | |
3435 return NGX_CONF_ERROR; | |
3436 #endif | |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
97
diff
changeset
|
3437 } |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3438 |
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3439 return NGX_CONF_OK; |
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
3440 } |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
3441 |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
3442 |
487 | 3443 static char * |
3444 ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3445 { |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3446 ngx_http_core_loc_conf_t *lcf = conf; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3447 |
595 | 3448 ngx_str_t *value; |
3449 ngx_uint_t alias, n; | |
3450 ngx_http_script_compile_t sc; | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3451 |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3452 alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3453 |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3454 if (lcf->root.data) { |
300
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
3455 |
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
3456 /* the (ngx_uint_t) cast is required by gcc 2.7.2.3 */ |
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
3457 |
502b03d9d2a3
nginx-0.0.3-2004-03-31-00:31:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
3458 if ((ngx_uint_t) lcf->alias == alias) { |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3459 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 3460 "\"%V\" directive is duplicate", |
3461 &cmd->name); | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3462 } else { |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3463 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 3464 "\"%V\" directive is duplicate, " |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3465 "\"%s\" directive is specified before", |
461 | 3466 &cmd->name, lcf->alias ? "alias" : "root"); |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3467 } |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3468 |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3469 return NGX_CONF_ERROR; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3470 } |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3471 |
1353 | 3472 if (lcf->named && alias) { |
3473 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3474 "the \"alias\" directive may not be used " | |
3475 "inside named location"); | |
3476 | |
3477 return NGX_CONF_ERROR; | |
3478 } | |
3479 | |
1234
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3480 #if (NGX_PCRE) |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3481 |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3482 if (lcf->regex && alias) { |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3483 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3484 "the \"alias\" directive may not be used " |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3485 "inside location given by regular expression"); |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3486 |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3487 return NGX_CONF_ERROR; |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3488 } |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3489 |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3490 #endif |
6be3d9073266
forbid alias inside location given by regular expression
Igor Sysoev <igor@sysoev.ru>
parents:
1209
diff
changeset
|
3491 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3492 value = cf->args->elts; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3493 |
1156 | 3494 if (ngx_strstr(value[1].data, "$document_root") |
3495 || ngx_strstr(value[1].data, "${document_root}")) | |
1155
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3496 { |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3497 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3498 "the $document_root variable may not be used " |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3499 "in the \"%V\" directive", |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3500 &cmd->name); |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3501 |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3502 return NGX_CONF_ERROR; |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3503 } |
39a3aa08eefe
disable $document_root variable in the "root/alias" directive
Igor Sysoev <igor@sysoev.ru>
parents:
1149
diff
changeset
|
3504 |
2263
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3505 if (ngx_strstr(value[1].data, "$realpath_root") |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3506 || ngx_strstr(value[1].data, "${realpath_root}")) |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3507 { |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3508 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3509 "the $realpath_root variable may not be used " |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3510 "in the \"%V\" directive", |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3511 &cmd->name); |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3512 |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3513 return NGX_CONF_ERROR; |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3514 } |
41b51261b726
disable $realpath_root variable in a "root" directive
Igor Sysoev <igor@sysoev.ru>
parents:
2261
diff
changeset
|
3515 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3516 lcf->alias = alias; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3517 lcf->root = value[1]; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3518 |
411
4765ded59eaa
nginx-0.0.10-2004-08-30-23:24:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
404
diff
changeset
|
3519 if (!alias && lcf->root.data[lcf->root.len - 1] == '/') { |
4765ded59eaa
nginx-0.0.10-2004-08-30-23:24:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
404
diff
changeset
|
3520 lcf->root.len--; |
4765ded59eaa
nginx-0.0.10-2004-08-30-23:24:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
404
diff
changeset
|
3521 } |
4765ded59eaa
nginx-0.0.10-2004-08-30-23:24:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
404
diff
changeset
|
3522 |
667 | 3523 if (lcf->root.data[0] != '$') { |
2536
a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
Igor Sysoev <igor@sysoev.ru>
parents:
2533
diff
changeset
|
3524 if (ngx_conf_full_name(cf->cycle, &lcf->root, 0) != NGX_OK) { |
667 | 3525 return NGX_CONF_ERROR; |
3526 } | |
603 | 3527 } |
3528 | |
3529 n = ngx_http_script_variables_count(&lcf->root); | |
595 | 3530 |
3531 if (n == 0) { | |
3532 return NGX_CONF_OK; | |
3533 } | |
3534 | |
3535 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); | |
3536 | |
3537 sc.cf = cf; | |
603 | 3538 sc.source = &lcf->root; |
595 | 3539 sc.lengths = &lcf->root_lengths; |
3540 sc.values = &lcf->root_values; | |
3541 sc.variables = n; | |
3542 sc.complete_lengths = 1; | |
3543 sc.complete_values = 1; | |
3544 | |
3545 if (ngx_http_script_compile(&sc) != NGX_OK) { | |
3546 return NGX_CONF_ERROR; | |
3547 } | |
3548 | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3549 return NGX_CONF_OK; |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3550 } |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3551 |
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
287
diff
changeset
|
3552 |
631 | 3553 static ngx_http_method_name_t ngx_methods_names[] = { |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3554 { (u_char *) "GET", (uint32_t) ~NGX_HTTP_GET }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3555 { (u_char *) "HEAD", (uint32_t) ~NGX_HTTP_HEAD }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3556 { (u_char *) "POST", (uint32_t) ~NGX_HTTP_POST }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3557 { (u_char *) "PUT", (uint32_t) ~NGX_HTTP_PUT }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3558 { (u_char *) "DELETE", (uint32_t) ~NGX_HTTP_DELETE }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3559 { (u_char *) "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3560 { (u_char *) "COPY", (uint32_t) ~NGX_HTTP_COPY }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3561 { (u_char *) "MOVE", (uint32_t) ~NGX_HTTP_MOVE }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3562 { (u_char *) "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3563 { (u_char *) "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3564 { (u_char *) "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3565 { (u_char *) "LOCK", (uint32_t) ~NGX_HTTP_LOCK }, |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
3566 { (u_char *) "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK }, |
631 | 3567 { NULL, 0 } |
3568 }; | |
3569 | |
3570 | |
3571 static char * | |
3572 ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
3573 { | |
2027 | 3574 ngx_http_core_loc_conf_t *pclcf = conf; |
631 | 3575 |
3576 char *rv; | |
3577 void *mconf; | |
3578 ngx_str_t *value; | |
3579 ngx_uint_t i; | |
3580 ngx_conf_t save; | |
3581 ngx_http_module_t *module; | |
3582 ngx_http_conf_ctx_t *ctx, *pctx; | |
3583 ngx_http_method_name_t *name; | |
2027 | 3584 ngx_http_core_loc_conf_t *clcf; |
3585 | |
3586 if (pclcf->limit_except) { | |
631 | 3587 return "duplicate"; |
3588 } | |
3589 | |
2027 | 3590 pclcf->limit_except = 0xffffffff; |
631 | 3591 |
3592 value = cf->args->elts; | |
3593 | |
3594 for (i = 1; i < cf->args->nelts; i++) { | |
3595 for (name = ngx_methods_names; name->name; name++) { | |
3596 | |
3597 if (ngx_strcasecmp(value[i].data, name->name) == 0) { | |
2027 | 3598 pclcf->limit_except &= name->method; |
631 | 3599 goto next; |
3600 } | |
3601 } | |
3602 | |
3603 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3604 "invalid method \"%V\"", &value[i]); | |
3605 return NGX_CONF_ERROR; | |
3606 | |
3607 next: | |
3608 continue; | |
3609 } | |
3610 | |
2027 | 3611 if (!(pclcf->limit_except & NGX_HTTP_GET)) { |
3612 pclcf->limit_except &= (uint32_t) ~NGX_HTTP_HEAD; | |
631 | 3613 } |
3614 | |
3615 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)); | |
3616 if (ctx == NULL) { | |
3617 return NGX_CONF_ERROR; | |
3618 } | |
3619 | |
3620 pctx = cf->ctx; | |
3621 ctx->main_conf = pctx->main_conf; | |
3622 ctx->srv_conf = pctx->srv_conf; | |
3623 | |
3624 ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module); | |
3625 if (ctx->loc_conf == NULL) { | |
3626 return NGX_CONF_ERROR; | |
3627 } | |
3628 | |
3629 for (i = 0; ngx_modules[i]; i++) { | |
3630 if (ngx_modules[i]->type != NGX_HTTP_MODULE) { | |
3631 continue; | |
3632 } | |
3633 | |
3634 module = ngx_modules[i]->ctx; | |
3635 | |
3636 if (module->create_loc_conf) { | |
3637 | |
3638 mconf = module->create_loc_conf(cf); | |
3639 if (mconf == NULL) { | |
3640 return NGX_CONF_ERROR; | |
3641 } | |
3642 | |
3643 ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf; | |
3644 } | |
3645 } | |
3646 | |
3647 | |
2027 | 3648 clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; |
3649 pclcf->limit_except_loc_conf = ctx->loc_conf; | |
3650 clcf->loc_conf = ctx->loc_conf; | |
3651 clcf->name = pclcf->name; | |
3652 clcf->noname = 1; | |
3653 | |
3654 if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { | |
631 | 3655 return NGX_CONF_ERROR; |
3656 } | |
3657 | |
3658 save = *cf; | |
3659 cf->ctx = ctx; | |
3660 cf->cmd_type = NGX_HTTP_LMT_CONF; | |
3661 | |
3662 rv = ngx_conf_parse(cf, NULL); | |
3663 | |
3664 *cf = save; | |
3665 | |
3666 return rv; | |
3667 } | |
3668 | |
3669 | |
487 | 3670 static char * |
2129 | 3671 ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3672 { | |
3673 ngx_http_core_loc_conf_t *clcf = conf; | |
3674 | |
3675 ngx_str_t *value; | |
3676 | |
3677 if (clcf->directio != NGX_CONF_UNSET) { | |
3678 return "is duplicate"; | |
3679 } | |
3680 | |
3681 value = cf->args->elts; | |
3682 | |
3683 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2277 | 3684 clcf->directio = NGX_OPEN_FILE_DIRECTIO_OFF; |
2129 | 3685 return NGX_CONF_OK; |
3686 } | |
3687 | |
3688 clcf->directio = ngx_parse_offset(&value[1]); | |
3689 if (clcf->directio == (off_t) NGX_ERROR) { | |
3690 return "invalid value"; | |
3691 } | |
3692 | |
3693 return NGX_CONF_OK; | |
3694 } | |
3695 | |
3696 | |
3697 static char * | |
487 | 3698 ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3699 { |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3700 ngx_http_core_loc_conf_t *lcf = conf; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3701 |
1982
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3702 u_char *args; |
673 | 3703 ngx_int_t overwrite; |
3704 ngx_str_t *value, uri; | |
3705 ngx_uint_t i, n, nvar; | |
3706 ngx_array_t *uri_lengths, *uri_values; | |
3707 ngx_http_err_page_t *err; | |
3708 ngx_http_script_compile_t sc; | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3709 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3710 if (lcf->error_pages == NULL) { |
487 | 3711 lcf->error_pages = ngx_array_create(cf->pool, 4, |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3712 sizeof(ngx_http_err_page_t)); |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3713 if (lcf->error_pages == NULL) { |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3714 return NGX_CONF_ERROR; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3715 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3716 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3717 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3718 value = cf->args->elts; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3719 |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3720 i = cf->args->nelts - 2; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3721 |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3722 if (value[i].data[0] == '=') { |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3723 if (i == 1) { |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3724 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 3725 "invalid value \"%V\"", &value[i]); |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3726 return NGX_CONF_ERROR; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3727 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3728 |
555 | 3729 if (value[i].len > 1) { |
3730 overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1); | |
3731 | |
3732 if (overwrite == NGX_ERROR) { | |
3733 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3734 "invalid value \"%V\"", &value[i]); | |
3735 return NGX_CONF_ERROR; | |
3736 } | |
3737 | |
3738 } else { | |
3739 overwrite = 0; | |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3740 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3741 |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3742 n = 2; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3743 |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3744 } else { |
555 | 3745 overwrite = -1; |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3746 n = 1; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3747 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3748 |
673 | 3749 uri = value[cf->args->nelts - 1]; |
3750 uri_lengths = NULL; | |
3751 uri_values = NULL; | |
3752 | |
3753 nvar = ngx_http_script_variables_count(&uri); | |
3754 | |
3755 if (nvar) { | |
3756 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); | |
3757 | |
3758 sc.cf = cf; | |
3759 sc.source = &uri; | |
3760 sc.lengths = &uri_lengths; | |
3761 sc.values = &uri_values; | |
3762 sc.variables = nvar; | |
3763 sc.complete_lengths = 1; | |
3764 sc.complete_values = 1; | |
3765 | |
3766 if (ngx_http_script_compile(&sc) != NGX_OK) { | |
3767 return NGX_CONF_ERROR; | |
3768 } | |
3769 } | |
3770 | |
1982
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3771 args = (u_char *) ngx_strchr(uri.data, '?'); |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3772 |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3773 for (i = 1; i < cf->args->nelts - n; i++) { |
501 | 3774 err = ngx_array_push(lcf->error_pages); |
3775 if (err == NULL) { | |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3776 return NGX_CONF_ERROR; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3777 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
318
diff
changeset
|
3778 |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
3779 err->status = ngx_atoi(value[i].data, value[i].len); |
487 | 3780 |
715 | 3781 if (err->status == NGX_ERROR || err->status == 499) { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3782 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 3783 "invalid value \"%V\"", &value[i]); |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3784 return NGX_CONF_ERROR; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3785 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3786 |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
3787 if (err->status < 400 || err->status > 599) { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3788 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
461 | 3789 "value \"%V\" must be between 400 and 599", |
3790 &value[i]); | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3791 return NGX_CONF_ERROR; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3792 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3793 |
1923
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3794 if (overwrite >= 0) { |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3795 err->overwrite = overwrite; |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3796 |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3797 } else { |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3798 switch (err->status) { |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3799 case NGX_HTTP_TO_HTTPS: |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3800 case NGX_HTTPS_CERT_ERROR: |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3801 case NGX_HTTPS_NO_CERT: |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3802 err->overwrite = NGX_HTTP_BAD_REQUEST; |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3803 break; |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3804 |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3805 default: |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3806 err->overwrite = err->status; |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3807 break; |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3808 } |
c72fe0a8d9b4
fix large memory allocation in "error_page 495-497 /uri"
Igor Sysoev <igor@sysoev.ru>
parents:
1919
diff
changeset
|
3809 } |
555 | 3810 |
1982
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3811 if (args) { |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3812 err->uri.len = args - uri.data; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3813 err->uri.data = uri.data; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3814 args++; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3815 err->args.len = (uri.data + uri.len) - args; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3816 err->args.data = args; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3817 |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3818 } else { |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3819 err->uri = uri; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3820 err->args.len = 0; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3821 err->args.data = NULL; |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3822 } |
dd388c80f5a2
args support in static error_page
Igor Sysoev <igor@sysoev.ru>
parents:
1957
diff
changeset
|
3823 |
673 | 3824 err->uri_lengths = uri_lengths; |
3825 err->uri_values = uri_values; | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3826 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3827 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3828 return NGX_CONF_OK; |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3829 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3830 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
3831 |
487 | 3832 static char * |
2407 | 3833 ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3834 { | |
3835 ngx_http_core_loc_conf_t *clcf = conf; | |
3836 | |
3837 ngx_str_t *value; | |
3838 ngx_uint_t i, n; | |
3839 ngx_http_try_file_t *tf; | |
3840 ngx_http_script_compile_t sc; | |
3841 ngx_http_core_main_conf_t *cmcf; | |
3842 | |
3843 if (clcf->try_files) { | |
3844 return "is duplicate"; | |
3845 } | |
3846 | |
3847 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); | |
3848 | |
3849 cmcf->try_files = 1; | |
3850 | |
3851 tf = ngx_pcalloc(cf->pool, cf->args->nelts * sizeof(ngx_http_try_file_t)); | |
3852 if (tf == NULL) { | |
3853 return NGX_CONF_ERROR; | |
3854 } | |
3855 | |
3856 clcf->try_files = tf; | |
3857 | |
3858 value = cf->args->elts; | |
3859 | |
3860 for (i = 0; i < cf->args->nelts - 1; i++) { | |
3861 | |
3862 tf[i].name = value[i + 1]; | |
3863 | |
2458
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
3864 if (tf[i].name.data[tf[i].name.len - 1] == '/') { |
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
3865 tf[i].test_dir = 1; |
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
3866 tf[i].name.len--; |
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
3867 } |
43dcf8cc2cb1
allow directories in try_files
Igor Sysoev <igor@sysoev.ru>
parents:
2453
diff
changeset
|
3868 |
2407 | 3869 n = ngx_http_script_variables_count(&tf[i].name); |
3870 | |
3871 if (n) { | |
3872 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); | |
3873 | |
3874 sc.cf = cf; | |
3875 sc.source = &tf[i].name; | |
3876 sc.lengths = &tf[i].lengths; | |
3877 sc.values = &tf[i].values; | |
3878 sc.variables = n; | |
3879 sc.complete_lengths = 1; | |
3880 sc.complete_values = 1; | |
3881 | |
3882 if (ngx_http_script_compile(&sc) != NGX_OK) { | |
3883 return NGX_CONF_ERROR; | |
3884 } | |
3885 | |
3886 } else { | |
3887 /* add trailing '\0' to length */ | |
3888 tf[i].name.len++; | |
3889 } | |
3890 } | |
3891 | |
3892 return NGX_CONF_OK; | |
3893 } | |
3894 | |
3895 | |
3896 static char * | |
1454 | 3897 ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3898 { | |
3899 ngx_http_core_loc_conf_t *lcf = conf; | |
3900 | |
3901 time_t inactive; | |
3902 ngx_str_t *value, s; | |
3903 ngx_int_t max; | |
3904 ngx_uint_t i; | |
3905 | |
3906 if (lcf->open_file_cache != NGX_CONF_UNSET_PTR) { | |
3907 return "is duplicate"; | |
3908 } | |
3909 | |
3910 value = cf->args->elts; | |
3911 | |
3912 max = 0; | |
3913 inactive = 60; | |
3914 | |
3915 for (i = 1; i < cf->args->nelts; i++) { | |
3916 | |
3917 if (ngx_strncmp(value[i].data, "max=", 4) == 0) { | |
3918 | |
3919 max = ngx_atoi(value[i].data + 4, value[i].len - 4); | |
3920 if (max == NGX_ERROR) { | |
2085
505af86ac9cb
show an error message for invalid parameter
Igor Sysoev <igor@sysoev.ru>
parents:
2067
diff
changeset
|
3921 goto failed; |
1454 | 3922 } |
3923 | |
3924 continue; | |
3925 } | |
3926 | |
3927 if (ngx_strncmp(value[i].data, "inactive=", 9) == 0) { | |
3928 | |
3929 s.len = value[i].len - 9; | |
3930 s.data = value[i].data + 9; | |
3931 | |
3932 inactive = ngx_parse_time(&s, 1); | |
3933 if (inactive < 0) { | |
2085
505af86ac9cb
show an error message for invalid parameter
Igor Sysoev <igor@sysoev.ru>
parents:
2067
diff
changeset
|
3934 goto failed; |
1454 | 3935 } |
3936 | |
3937 continue; | |
3938 } | |
3939 | |
3940 if (ngx_strcmp(value[i].data, "off") == 0) { | |
3941 | |
3942 lcf->open_file_cache = NULL; | |
3943 | |
3944 continue; | |
3945 } | |
3946 | |
2085
505af86ac9cb
show an error message for invalid parameter
Igor Sysoev <igor@sysoev.ru>
parents:
2067
diff
changeset
|
3947 failed: |
505af86ac9cb
show an error message for invalid parameter
Igor Sysoev <igor@sysoev.ru>
parents:
2067
diff
changeset
|
3948 |
1454 | 3949 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
3950 "invalid \"open_file_cache\" parameter \"%V\"", | |
3951 &value[i]); | |
3952 return NGX_CONF_ERROR; | |
3953 } | |
3954 | |
3955 if (lcf->open_file_cache == NULL) { | |
3956 return NGX_CONF_OK; | |
3957 } | |
3958 | |
3959 if (max == 0) { | |
3960 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
3961 "\"open_file_cache\" must have \"max\" parameter"); | |
3962 return NGX_CONF_ERROR; | |
3963 } | |
3964 | |
3965 lcf->open_file_cache = ngx_open_file_cache_init(cf->pool, max, inactive); | |
3966 if (lcf->open_file_cache) { | |
3967 return NGX_CONF_OK; | |
3968 } | |
3969 | |
3970 return NGX_CONF_ERROR; | |
3971 } | |
3972 | |
3973 | |
3974 static char * | |
509 | 3975 ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3976 { | |
3977 ngx_http_core_loc_conf_t *lcf = conf; | |
3978 | |
3979 lcf->err_log = ngx_log_create_errlog(cf->cycle, cf->args); | |
3980 if (lcf->err_log == NULL) { | |
3981 return NGX_CONF_ERROR; | |
3982 } | |
3983 | |
3984 return ngx_set_error_log_levels(cf, lcf->err_log); | |
3985 } | |
3986 | |
3987 | |
3988 static char * | |
487 | 3989 ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3990 { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3991 ngx_http_core_loc_conf_t *lcf = conf; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3992 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3993 ngx_str_t *value; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3994 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3995 if (lcf->keepalive_timeout != NGX_CONF_UNSET_MSEC) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3996 return "is duplicate"; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3997 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3998 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
3999 value = cf->args->elts; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4000 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4001 lcf->keepalive_timeout = ngx_parse_time(&value[1], 0); |
487 | 4002 |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4003 if (lcf->keepalive_timeout == (ngx_msec_t) NGX_ERROR) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4004 return "invalid value"; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4005 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4006 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4007 if (lcf->keepalive_timeout == (ngx_msec_t) NGX_PARSE_LARGE_TIME) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4008 return "value must be less than 597 hours"; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4009 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4010 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4011 if (cf->args->nelts == 2) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4012 return NGX_CONF_OK; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4013 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4014 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4015 lcf->keepalive_header = ngx_parse_time(&value[2], 1); |
487 | 4016 |
429
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4017 if (lcf->keepalive_header == NGX_ERROR) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4018 return "invalid value"; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4019 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4020 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4021 if (lcf->keepalive_header == NGX_PARSE_LARGE_TIME) { |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4022 return "value must be less than 68 years"; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4023 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4024 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4025 return NGX_CONF_OK; |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4026 } |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4027 |
694cd6cdb714
nginx-0.0.11-2004-09-17-20:07:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
426
diff
changeset
|
4028 |
487 | 4029 static char * |
509 | 4030 ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
4031 { |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
4032 ngx_http_core_loc_conf_t *lcf = conf; |
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
4033 |
509 | 4034 if (lcf->internal != NGX_CONF_UNSET) { |
4035 return "is duplicate"; | |
234
cd71b95716b4
nginx-0.0.1-2004-01-20-23:40:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
218
diff
changeset
|
4036 } |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
4037 |
509 | 4038 lcf->internal = 1; |
4039 | |
4040 return NGX_CONF_OK; | |
114
ac69ab96328d
nginx-0.0.1-2003-07-07-10:11:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
113
diff
changeset
|
4041 } |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4042 |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4043 |
487 | 4044 static char * |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4045 ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4046 { |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4047 ngx_http_core_loc_conf_t *clcf = conf; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4048 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4049 ngx_url_t u; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4050 ngx_str_t *value; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4051 |
1919
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
4052 if (clcf->resolver) { |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
4053 return "is duplicate"; |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
4054 } |
dc0f5013f674
create dummy resolver in http context to inherit it in all servers
Igor Sysoev <igor@sysoev.ru>
parents:
1915
diff
changeset
|
4055 |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4056 value = cf->args->elts; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4057 |
1675 | 4058 ngx_memzero(&u, sizeof(ngx_url_t)); |
4059 | |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4060 u.host = value[1]; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4061 u.port = 53; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4062 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4063 if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) { |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4064 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err); |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4065 return NGX_CONF_ERROR; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4066 } |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4067 |
1913
c0f873458e2b
use cf->cycle->new_log because at merge stage cf->pool->log is old log
Igor Sysoev <igor@sysoev.ru>
parents:
1906
diff
changeset
|
4068 clcf->resolver = ngx_resolver_create(cf, &u.addrs[0]); |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4069 if (clcf->resolver == NULL) { |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4070 return NGX_OK; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4071 } |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4072 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4073 return NGX_CONF_OK; |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4074 } |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4075 |
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4076 |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4077 #if (NGX_HTTP_GZIP) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4078 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4079 static char * |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4080 ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4081 { |
2205 | 4082 ngx_http_core_loc_conf_t *clcf = conf; |
4083 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4084 #if (NGX_PCRE) |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4085 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4086 ngx_str_t err, *value; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4087 ngx_uint_t i; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4088 ngx_regex_elt_t *re; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4089 u_char errstr[NGX_MAX_CONF_ERRSTR]; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4090 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4091 if (clcf->gzip_disable == NGX_CONF_UNSET_PTR) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4092 clcf->gzip_disable = ngx_array_create(cf->pool, 2, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4093 sizeof(ngx_regex_elt_t)); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4094 if (clcf->gzip_disable == NULL) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4095 return NGX_CONF_ERROR; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4096 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4097 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4098 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4099 value = cf->args->elts; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4100 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4101 err.len = NGX_MAX_CONF_ERRSTR; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4102 err.data = errstr; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4103 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4104 for (i = 1; i < cf->args->nelts; i++) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4105 |
2205 | 4106 if (ngx_strcmp(value[1].data, "msie6") == 0) { |
4107 clcf->gzip_disable_msie6 = 1; | |
4108 continue; | |
4109 } | |
4110 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4111 re = ngx_array_push(clcf->gzip_disable); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4112 if (re == NULL) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4113 return NGX_CONF_ERROR; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4114 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4115 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4116 re->regex = ngx_regex_compile(&value[i], NGX_REGEX_CASELESS, cf->pool, |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4117 &err); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4118 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4119 if (re->regex == NULL) { |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4120 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data); |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4121 return NGX_CONF_ERROR; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4122 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4123 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4124 re->name = value[i].data; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4125 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4126 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4127 return NGX_CONF_OK; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4128 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4129 #else |
2205 | 4130 ngx_str_t *value; |
4131 | |
4132 value = cf->args->elts; | |
4133 | |
4134 if (cf->args->nelts == 2 && ngx_strcmp(value[1].data, "msie6") == 0) { | |
4135 clcf->gzip_disable_msie6 = 1; | |
4136 return NGX_CONF_OK; | |
4137 } | |
4138 | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4139 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
2205 | 4140 "without PCRE library \"gzip_disable\" supports " |
4141 "builtin \"msie6\" mask only"); | |
1790
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4142 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4143 return NGX_CONF_ERROR; |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4144 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4145 } |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4146 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4147 #endif |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4148 |
775edc46ee66
ngx_http_gzip_static_module and gzip_disable
Igor Sysoev <igor@sysoev.ru>
parents:
1781
diff
changeset
|
4149 |
1652
cc7a7d0b89e8
http resolver and resolver_timeout
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
4150 static char * |
487 | 4151 ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data) |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4152 { |
473 | 4153 #if (NGX_FREEBSD) |
452 | 4154 ssize_t *np = data; |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4155 |
673 | 4156 if ((u_long) *np >= ngx_freebsd_net_inet_tcp_sendspace) { |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4157 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4158 "\"send_lowat\" must be less than %d " |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4159 "(sysctl net.inet.tcp.sendspace)", |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4160 ngx_freebsd_net_inet_tcp_sendspace); |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4161 |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4162 return NGX_CONF_ERROR; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4163 } |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4164 |
469 | 4165 #elif !(NGX_HAVE_SO_SNDLOWAT) |
473 | 4166 ssize_t *np = data; |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4167 |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4168 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4169 "\"send_lowat\" is not supported, ignored"); |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4170 |
452 | 4171 *np = 0; |
4172 | |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4173 #endif |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4174 |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4175 return NGX_CONF_OK; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
4176 } |
1200 | 4177 |
4178 | |
4179 static char * | |
4180 ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data) | |
4181 { | |
4182 size_t *sp = data; | |
4183 | |
4184 if (*sp < NGX_MIN_POOL_SIZE) { | |
4185 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
4186 "pool must be no less than %uz", NGX_MIN_POOL_SIZE); | |
4187 | |
4188 return NGX_CONF_ERROR; | |
4189 } | |
4190 | |
4191 return NGX_CONF_OK; | |
4192 } |