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