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