nginxtra 1.2.4.7 → 1.2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/nginxtra +1 -1
- data/bin/nginxtra_rails +1 -1
- data/lib/nginxtra/version.rb +5 -1
- data/vendor/nginx/CHANGES +20 -0
- data/vendor/nginx/CHANGES.ru +21 -0
- data/vendor/nginx/auto/lib/perl/conf +9 -1
- data/vendor/nginx/auto/make +3 -3
- data/vendor/nginx/auto/options +4 -0
- data/vendor/nginx/src/core/nginx.c +33 -2
- data/vendor/nginx/src/core/nginx.h +2 -2
- data/vendor/nginx/src/core/ngx_cycle.c +10 -8
- data/vendor/nginx/src/core/ngx_cycle.h +1 -1
- data/vendor/nginx/src/core/ngx_file.c +6 -6
- data/vendor/nginx/src/core/ngx_file.h +1 -1
- data/vendor/nginx/src/core/ngx_resolver.c +29 -2
- data/vendor/nginx/src/event/ngx_event_openssl.c +5 -3
- data/vendor/nginx/src/event/ngx_event_openssl.h +7 -0
- data/vendor/nginx/src/event/ngx_event_pipe.c +9 -2
- data/vendor/nginx/src/http/modules/ngx_http_log_module.c +0 -31
- data/vendor/nginx/src/http/modules/ngx_http_ssl_module.c +2 -1
- data/vendor/nginx/src/http/modules/perl/nginx.pm +1 -1
- data/vendor/nginx/src/http/ngx_http_request.c +17 -1
- data/vendor/nginx/src/http/ngx_http_upstream.c +1 -0
- data/vendor/nginx/src/http/ngx_http_variables.c +79 -0
- data/vendor/nginx/src/os/unix/ngx_process.c +0 -4
- data/vendor/nginx/src/os/unix/ngx_process_cycle.c +8 -6
- metadata +4 -4
data/bin/nginxtra
CHANGED
data/bin/nginxtra_rails
CHANGED
data/lib/nginxtra/version.rb
CHANGED
data/vendor/nginx/CHANGES
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
Changes with nginx 1.2.5 13 Nov 2012
|
|
3
|
+
|
|
4
|
+
*) Feature: the "optional_no_ca" parameter of the "ssl_verify_client"
|
|
5
|
+
directive.
|
|
6
|
+
Thanks to Mike Kazantsev and Eric O'Connor.
|
|
7
|
+
|
|
8
|
+
*) Feature: the $bytes_sent, $connection, and $connection_requests
|
|
9
|
+
variables can now be used not only in the "log_format" directive.
|
|
10
|
+
Thanks to Benjamin Grössing.
|
|
11
|
+
|
|
12
|
+
*) Feature: resolver now randomly rotates addresses returned from cache.
|
|
13
|
+
Thanks to Anton Jouline.
|
|
14
|
+
|
|
15
|
+
*) Feature: the "auto" parameter of the "worker_processes" directive.
|
|
16
|
+
|
|
17
|
+
*) Bugfix: "cache file ... has md5 collision" alert.
|
|
18
|
+
|
|
19
|
+
*) Bugfix: OpenSSL 0.9.7 compatibility.
|
|
20
|
+
|
|
21
|
+
|
|
2
22
|
Changes with nginx 1.2.4 25 Sep 2012
|
|
3
23
|
|
|
4
24
|
*) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14.
|
data/vendor/nginx/CHANGES.ru
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
Изменения в nginx 1.2.5 13.11.2012
|
|
3
|
+
|
|
4
|
+
*) Добавление: параметр optional_no_ca директивы ssl_verify_client.
|
|
5
|
+
Спасибо Михаилу Казанцеву и Eric O'Connor.
|
|
6
|
+
|
|
7
|
+
*) Добавление: переменные $bytes_sent, $connection и
|
|
8
|
+
$connection_requests теперь можно использовать не только в директиве
|
|
9
|
+
log_format.
|
|
10
|
+
Спасибо Benjamin Grössing.
|
|
11
|
+
|
|
12
|
+
*) Добавление: теперь resolver случайным образом меняет порядок
|
|
13
|
+
возвращаемых закэшированных адресов.
|
|
14
|
+
Спасибо Антону Жулину.
|
|
15
|
+
|
|
16
|
+
*) Добавление: параметр auto директивы worker_processes.
|
|
17
|
+
|
|
18
|
+
*) Исправление: сообщения "cache file ... has md5 collision".
|
|
19
|
+
|
|
20
|
+
*) Исправление: совместимость с OpenSSL 0.9.7.
|
|
21
|
+
|
|
22
|
+
|
|
2
23
|
Изменения в nginx 1.2.4 25.09.2012
|
|
3
24
|
|
|
4
25
|
*) Исправление: в директиве "limit_req"; ошибка появилась в 1.1.14.
|
|
@@ -12,7 +12,7 @@ NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \
|
|
|
12
12
|
if test -n "$NGX_PERL_VER"; then
|
|
13
13
|
echo " + perl version: $NGX_PERL_VER"
|
|
14
14
|
|
|
15
|
-
if [ "
|
|
15
|
+
if [ "`$NGX_PERL -e 'use 5.006001; print "OK"'`" != "OK" ]; then
|
|
16
16
|
echo
|
|
17
17
|
echo "$0: error: perl 5.6.1 or higher is required"
|
|
18
18
|
echo
|
|
@@ -20,6 +20,14 @@ if test -n "$NGX_PERL_VER"; then
|
|
|
20
20
|
exit 1;
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
+
if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then
|
|
24
|
+
echo
|
|
25
|
+
echo "$0: error: perl module ExtUtils::Embed is required"
|
|
26
|
+
echo
|
|
27
|
+
|
|
28
|
+
exit 1;
|
|
29
|
+
fi
|
|
30
|
+
|
|
23
31
|
NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
|
|
24
32
|
NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
|
|
25
33
|
|
data/vendor/nginx/auto/make
CHANGED
|
@@ -49,7 +49,7 @@ END
|
|
|
49
49
|
ngx_all_srcs="$CORE_SRCS"
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
# the core dependences and include
|
|
52
|
+
# the core dependences and include paths
|
|
53
53
|
|
|
54
54
|
ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
|
|
55
55
|
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
|
|
@@ -69,7 +69,7 @@ CORE_INCS = $ngx_include_opt$ngx_incs
|
|
|
69
69
|
END
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
# the http dependences and include
|
|
72
|
+
# the http dependences and include paths
|
|
73
73
|
|
|
74
74
|
if [ $HTTP = YES ]; then
|
|
75
75
|
|
|
@@ -95,7 +95,7 @@ END
|
|
|
95
95
|
fi
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
# the mail dependences and include
|
|
98
|
+
# the mail dependences and include paths
|
|
99
99
|
|
|
100
100
|
if [ $MAIL = YES ]; then
|
|
101
101
|
|
data/vendor/nginx/auto/options
CHANGED
|
@@ -385,6 +385,10 @@ cat << END
|
|
|
385
385
|
--without-http_browser_module disable ngx_http_browser_module
|
|
386
386
|
--without-http_upstream_ip_hash_module
|
|
387
387
|
disable ngx_http_upstream_ip_hash_module
|
|
388
|
+
--without-http_upstream_least_conn_module
|
|
389
|
+
disable ngx_http_upstream_least_conn_module
|
|
390
|
+
--without-http_upstream_keepalive_module
|
|
391
|
+
disable ngx_http_upstream_keepalive_module
|
|
388
392
|
|
|
389
393
|
--with-http_perl_module enable ngx_http_perl_module
|
|
390
394
|
--with-perl_modules_path=PATH set Perl modules path
|
|
@@ -21,6 +21,8 @@ static char *ngx_set_env(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
|
|
21
21
|
static char *ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
|
22
22
|
static char *ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd,
|
|
23
23
|
void *conf);
|
|
24
|
+
static char *ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd,
|
|
25
|
+
void *conf);
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
static ngx_conf_enum_t ngx_debug_points[] = {
|
|
@@ -69,9 +71,9 @@ static ngx_command_t ngx_core_commands[] = {
|
|
|
69
71
|
|
|
70
72
|
{ ngx_string("worker_processes"),
|
|
71
73
|
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
|
|
72
|
-
|
|
74
|
+
ngx_set_worker_processes,
|
|
75
|
+
0,
|
|
73
76
|
0,
|
|
74
|
-
offsetof(ngx_core_conf_t, worker_processes),
|
|
75
77
|
NULL },
|
|
76
78
|
|
|
77
79
|
{ ngx_string("debug_points"),
|
|
@@ -1329,3 +1331,32 @@ ngx_get_cpu_affinity(ngx_uint_t n)
|
|
|
1329
1331
|
|
|
1330
1332
|
return ccf->cpu_affinity[ccf->cpu_affinity_n - 1];
|
|
1331
1333
|
}
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
static char *
|
|
1337
|
+
ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
1338
|
+
{
|
|
1339
|
+
ngx_str_t *value;
|
|
1340
|
+
ngx_core_conf_t *ccf;
|
|
1341
|
+
|
|
1342
|
+
ccf = (ngx_core_conf_t *) conf;
|
|
1343
|
+
|
|
1344
|
+
if (ccf->worker_processes != NGX_CONF_UNSET) {
|
|
1345
|
+
return "is duplicate";
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
value = (ngx_str_t *) cf->args->elts;
|
|
1349
|
+
|
|
1350
|
+
if (ngx_strcmp(value[1].data, "auto") == 0) {
|
|
1351
|
+
ccf->worker_processes = ngx_ncpu;
|
|
1352
|
+
return NGX_CONF_OK;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
ccf->worker_processes = ngx_atoi(value[1].data, value[1].len);
|
|
1356
|
+
|
|
1357
|
+
if (ccf->worker_processes == NGX_ERROR) {
|
|
1358
|
+
return "invalid value";
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
return NGX_CONF_OK;
|
|
1362
|
+
}
|
|
@@ -118,18 +118,18 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
n = old_cycle->
|
|
121
|
+
n = old_cycle->paths.nelts ? old_cycle->paths.nelts : 10;
|
|
122
122
|
|
|
123
|
-
cycle->
|
|
124
|
-
if (cycle->
|
|
123
|
+
cycle->paths.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *));
|
|
124
|
+
if (cycle->paths.elts == NULL) {
|
|
125
125
|
ngx_destroy_pool(pool);
|
|
126
126
|
return NULL;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
cycle->
|
|
130
|
-
cycle->
|
|
131
|
-
cycle->
|
|
132
|
-
cycle->
|
|
129
|
+
cycle->paths.nelts = 0;
|
|
130
|
+
cycle->paths.size = sizeof(ngx_path_t *);
|
|
131
|
+
cycle->paths.nalloc = n;
|
|
132
|
+
cycle->paths.pool = pool;
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
if (old_cycle->open_files.part.nelts) {
|
|
@@ -334,7 +334,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
|
|
337
|
-
if (
|
|
337
|
+
if (ngx_create_paths(cycle, ccf->user) != NGX_OK) {
|
|
338
338
|
goto failed;
|
|
339
339
|
}
|
|
340
340
|
|
|
@@ -1038,6 +1038,8 @@ ngx_signal_process(ngx_cycle_t *cycle, char *sig)
|
|
|
1038
1038
|
|
|
1039
1039
|
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
|
1040
1040
|
|
|
1041
|
+
ngx_memzero(&file, sizeof(ngx_file_t));
|
|
1042
|
+
|
|
1041
1043
|
file.name = ccf->pid;
|
|
1042
1044
|
file.log = cycle->log;
|
|
1043
1045
|
|
|
@@ -412,8 +412,8 @@ ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)
|
|
|
412
412
|
|
|
413
413
|
path = *slot;
|
|
414
414
|
|
|
415
|
-
p = cf->cycle->
|
|
416
|
-
for (i = 0; i < cf->cycle->
|
|
415
|
+
p = cf->cycle->paths.elts;
|
|
416
|
+
for (i = 0; i < cf->cycle->paths.nelts; i++) {
|
|
417
417
|
if (p[i]->name.len == path->name.len
|
|
418
418
|
&& ngx_strcmp(p[i]->name.data, path->name.data) == 0)
|
|
419
419
|
{
|
|
@@ -457,7 +457,7 @@ ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
p = ngx_array_push(&cf->cycle->
|
|
460
|
+
p = ngx_array_push(&cf->cycle->paths);
|
|
461
461
|
if (p == NULL) {
|
|
462
462
|
return NGX_ERROR;
|
|
463
463
|
}
|
|
@@ -469,14 +469,14 @@ ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot)
|
|
|
469
469
|
|
|
470
470
|
|
|
471
471
|
ngx_int_t
|
|
472
|
-
|
|
472
|
+
ngx_create_paths(ngx_cycle_t *cycle, ngx_uid_t user)
|
|
473
473
|
{
|
|
474
474
|
ngx_err_t err;
|
|
475
475
|
ngx_uint_t i;
|
|
476
476
|
ngx_path_t **path;
|
|
477
477
|
|
|
478
|
-
path = cycle->
|
|
479
|
-
for (i = 0; i < cycle->
|
|
478
|
+
path = cycle->paths.elts;
|
|
479
|
+
for (i = 0; i < cycle->paths.nelts; i++) {
|
|
480
480
|
|
|
481
481
|
if (ngx_create_dir(path[i]->name.data, 0700) == NGX_FILE_ERROR) {
|
|
482
482
|
err = ngx_errno;
|
|
@@ -130,7 +130,7 @@ void ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len);
|
|
|
130
130
|
ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path);
|
|
131
131
|
ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
|
|
132
132
|
ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot);
|
|
133
|
-
ngx_int_t
|
|
133
|
+
ngx_int_t ngx_create_paths(ngx_cycle_t *cycle, ngx_uid_t user);
|
|
134
134
|
ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to,
|
|
135
135
|
ngx_ext_rename_file_t *ext);
|
|
136
136
|
ngx_int_t ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf);
|
|
@@ -88,6 +88,8 @@ static void *ngx_resolver_calloc(ngx_resolver_t *r, size_t size);
|
|
|
88
88
|
static void ngx_resolver_free(ngx_resolver_t *r, void *p);
|
|
89
89
|
static void ngx_resolver_free_locked(ngx_resolver_t *r, void *p);
|
|
90
90
|
static void *ngx_resolver_dup(ngx_resolver_t *r, void *src, size_t size);
|
|
91
|
+
static in_addr_t *ngx_resolver_rotate(ngx_resolver_t *r, in_addr_t *src,
|
|
92
|
+
ngx_uint_t n);
|
|
91
93
|
static u_char *ngx_resolver_log_error(ngx_log_t *log, u_char *buf, size_t len);
|
|
92
94
|
|
|
93
95
|
|
|
@@ -445,8 +447,7 @@ ngx_resolve_name_locked(ngx_resolver_t *r, ngx_resolver_ctx_t *ctx)
|
|
|
445
447
|
|
|
446
448
|
if (naddrs != 1) {
|
|
447
449
|
addr = 0;
|
|
448
|
-
addrs =
|
|
449
|
-
naddrs * sizeof(in_addr_t));
|
|
450
|
+
addrs = ngx_resolver_rotate(r, rn->u.addrs, naddrs);
|
|
450
451
|
if (addrs == NULL) {
|
|
451
452
|
return NGX_ERROR;
|
|
452
453
|
}
|
|
@@ -2135,6 +2136,32 @@ ngx_resolver_dup(ngx_resolver_t *r, void *src, size_t size)
|
|
|
2135
2136
|
}
|
|
2136
2137
|
|
|
2137
2138
|
|
|
2139
|
+
static in_addr_t *
|
|
2140
|
+
ngx_resolver_rotate(ngx_resolver_t *r, in_addr_t *src, ngx_uint_t n)
|
|
2141
|
+
{
|
|
2142
|
+
void *dst, *p;
|
|
2143
|
+
ngx_uint_t j;
|
|
2144
|
+
|
|
2145
|
+
dst = ngx_resolver_alloc(r, n * sizeof(in_addr_t));
|
|
2146
|
+
|
|
2147
|
+
if (dst == NULL) {
|
|
2148
|
+
return dst;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
j = ngx_random() % n;
|
|
2152
|
+
|
|
2153
|
+
if (j == 0) {
|
|
2154
|
+
ngx_memcpy(dst, src, n * sizeof(in_addr_t));
|
|
2155
|
+
return dst;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
p = ngx_cpymem(dst, &src[j], (n - j) * sizeof(in_addr_t));
|
|
2159
|
+
ngx_memcpy(p, src, j * sizeof(in_addr_t));
|
|
2160
|
+
|
|
2161
|
+
return dst;
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
|
|
2138
2165
|
char *
|
|
2139
2166
|
ngx_resolver_strerror(ngx_int_t err)
|
|
2140
2167
|
{
|
|
@@ -94,22 +94,24 @@ ngx_ssl_init(ngx_log_t *log)
|
|
|
94
94
|
|
|
95
95
|
OpenSSL_add_all_algorithms();
|
|
96
96
|
|
|
97
|
+
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
|
|
97
98
|
#ifndef SSL_OP_NO_COMPRESSION
|
|
98
99
|
{
|
|
99
100
|
/*
|
|
100
101
|
* Disable gzip compression in OpenSSL prior to 1.0.0 version,
|
|
101
102
|
* this saves about 522K per connection.
|
|
102
103
|
*/
|
|
103
|
-
int
|
|
104
|
+
int n;
|
|
104
105
|
STACK_OF(SSL_COMP) *ssl_comp_methods;
|
|
105
106
|
|
|
106
107
|
ssl_comp_methods = SSL_COMP_get_compression_methods();
|
|
107
108
|
n = sk_SSL_COMP_num(ssl_comp_methods);
|
|
108
109
|
|
|
109
|
-
|
|
110
|
-
(void)
|
|
110
|
+
while (n--) {
|
|
111
|
+
(void) sk_SSL_COMP_pop(ssl_comp_methods);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
#endif
|
|
113
115
|
#endif
|
|
114
116
|
|
|
115
117
|
ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
|
|
@@ -120,6 +120,13 @@ ngx_int_t ngx_ssl_set_session(ngx_connection_t *c, ngx_ssl_session_t *session);
|
|
|
120
120
|
#define ngx_ssl_get_server_conf(ssl_ctx) \
|
|
121
121
|
SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_server_conf_index)
|
|
122
122
|
|
|
123
|
+
#define ngx_ssl_verify_error_optional(n) \
|
|
124
|
+
(n == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT \
|
|
125
|
+
|| n == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN \
|
|
126
|
+
|| n == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY \
|
|
127
|
+
|| n == X509_V_ERR_CERT_UNTRUSTED \
|
|
128
|
+
|| n == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE)
|
|
129
|
+
|
|
123
130
|
|
|
124
131
|
ngx_int_t ngx_ssl_get_protocol(ngx_connection_t *c, ngx_pool_t *pool,
|
|
125
132
|
ngx_str_t *s);
|
|
@@ -946,8 +946,15 @@ ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b)
|
|
|
946
946
|
return NGX_ERROR;
|
|
947
947
|
}
|
|
948
948
|
|
|
949
|
-
|
|
950
|
-
|
|
949
|
+
if (p->buf_to_file && b->start == p->buf_to_file->start) {
|
|
950
|
+
b->pos = p->buf_to_file->last;
|
|
951
|
+
b->last = p->buf_to_file->last;
|
|
952
|
+
|
|
953
|
+
} else {
|
|
954
|
+
b->pos = b->start;
|
|
955
|
+
b->last = b->start;
|
|
956
|
+
}
|
|
957
|
+
|
|
951
958
|
b->shadow = NULL;
|
|
952
959
|
|
|
953
960
|
cl->buf = b;
|
|
@@ -78,10 +78,6 @@ static void ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log,
|
|
|
78
78
|
static ssize_t ngx_http_log_script_write(ngx_http_request_t *r,
|
|
79
79
|
ngx_http_log_script_t *script, u_char **name, u_char *buf, size_t len);
|
|
80
80
|
|
|
81
|
-
static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
|
|
82
|
-
ngx_http_log_op_t *op);
|
|
83
|
-
static u_char *ngx_http_log_connection_requests(ngx_http_request_t *r,
|
|
84
|
-
u_char *buf, ngx_http_log_op_t *op);
|
|
85
81
|
static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf,
|
|
86
82
|
ngx_http_log_op_t *op);
|
|
87
83
|
static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf,
|
|
@@ -194,9 +190,6 @@ static ngx_str_t ngx_http_combined_fmt =
|
|
|
194
190
|
|
|
195
191
|
|
|
196
192
|
static ngx_http_log_var_t ngx_http_log_vars[] = {
|
|
197
|
-
{ ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection },
|
|
198
|
-
{ ngx_string("connection_requests"), NGX_INT_T_LEN,
|
|
199
|
-
ngx_http_log_connection_requests },
|
|
200
193
|
{ ngx_string("pipe"), 1, ngx_http_log_pipe },
|
|
201
194
|
{ ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1,
|
|
202
195
|
ngx_http_log_time },
|
|
@@ -209,8 +202,6 @@ static ngx_http_log_var_t ngx_http_log_vars[] = {
|
|
|
209
202
|
{ ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent },
|
|
210
203
|
{ ngx_string("body_bytes_sent"), NGX_OFF_T_LEN,
|
|
211
204
|
ngx_http_log_body_bytes_sent },
|
|
212
|
-
{ ngx_string("apache_bytes_sent"), NGX_OFF_T_LEN,
|
|
213
|
-
ngx_http_log_body_bytes_sent },
|
|
214
205
|
{ ngx_string("request_length"), NGX_SIZE_T_LEN,
|
|
215
206
|
ngx_http_log_request_length },
|
|
216
207
|
|
|
@@ -501,22 +492,6 @@ ngx_http_log_copy_long(ngx_http_request_t *r, u_char *buf,
|
|
|
501
492
|
}
|
|
502
493
|
|
|
503
494
|
|
|
504
|
-
static u_char *
|
|
505
|
-
ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
|
|
506
|
-
ngx_http_log_op_t *op)
|
|
507
|
-
{
|
|
508
|
-
return ngx_sprintf(buf, "%uA", r->connection->number);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
static u_char *
|
|
513
|
-
ngx_http_log_connection_requests(ngx_http_request_t *r, u_char *buf,
|
|
514
|
-
ngx_http_log_op_t *op)
|
|
515
|
-
{
|
|
516
|
-
return ngx_sprintf(buf, "%ui", r->connection->requests);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
495
|
static u_char *
|
|
521
496
|
ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
|
522
497
|
{
|
|
@@ -1143,12 +1118,6 @@ ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *flushes,
|
|
|
1143
1118
|
goto invalid;
|
|
1144
1119
|
}
|
|
1145
1120
|
|
|
1146
|
-
if (ngx_strncmp(var.data, "apache_bytes_sent", 17) == 0) {
|
|
1147
|
-
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
1148
|
-
"use \"$body_bytes_sent\" instead of "
|
|
1149
|
-
"\"$apache_bytes_sent\"");
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
1121
|
for (v = ngx_http_log_vars; v->name.len; v++) {
|
|
1153
1122
|
|
|
1154
1123
|
if (v->name.len == var.len
|
|
@@ -48,6 +48,7 @@ static ngx_conf_enum_t ngx_http_ssl_verify[] = {
|
|
|
48
48
|
{ ngx_string("off"), 0 },
|
|
49
49
|
{ ngx_string("on"), 1 },
|
|
50
50
|
{ ngx_string("optional"), 2 },
|
|
51
|
+
{ ngx_string("optional_no_ca"), 3 },
|
|
51
52
|
{ ngx_null_string, 0 }
|
|
52
53
|
};
|
|
53
54
|
|
|
@@ -466,7 +467,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
|
|
466
467
|
|
|
467
468
|
if (conf->verify) {
|
|
468
469
|
|
|
469
|
-
if (conf->client_certificate.len == 0) {
|
|
470
|
+
if (conf->client_certificate.len == 0 && conf->verify != 3) {
|
|
470
471
|
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
|
|
471
472
|
"no ssl_client_certificate for ssl_client_verify");
|
|
472
473
|
return NGX_CONF_ERROR;
|
|
@@ -1634,7 +1634,9 @@ ngx_http_process_request(ngx_http_request_t *r)
|
|
|
1634
1634
|
if (sscf->verify) {
|
|
1635
1635
|
rc = SSL_get_verify_result(c->ssl->connection);
|
|
1636
1636
|
|
|
1637
|
-
if (rc != X509_V_OK
|
|
1637
|
+
if (rc != X509_V_OK
|
|
1638
|
+
&& (sscf->verify != 3 || !ngx_ssl_verify_error_optional(rc)))
|
|
1639
|
+
{
|
|
1638
1640
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
1639
1641
|
"client SSL certificate verify error: (%l:%s)",
|
|
1640
1642
|
rc, X509_verify_cert_error_string(rc));
|
|
@@ -2743,6 +2745,20 @@ ngx_http_keepalive_handler(ngx_event_t *rev)
|
|
|
2743
2745
|
ngx_http_close_connection(c);
|
|
2744
2746
|
}
|
|
2745
2747
|
|
|
2748
|
+
/*
|
|
2749
|
+
* Like ngx_http_set_keepalive() we are trying to not hold
|
|
2750
|
+
* c->buffer's memory for a keepalive connection.
|
|
2751
|
+
*/
|
|
2752
|
+
|
|
2753
|
+
if (ngx_pfree(c->pool, b->start) == NGX_OK) {
|
|
2754
|
+
|
|
2755
|
+
/*
|
|
2756
|
+
* the special note that c->buffer's memory was freed
|
|
2757
|
+
*/
|
|
2758
|
+
|
|
2759
|
+
b->pos = NULL;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2746
2762
|
return;
|
|
2747
2763
|
}
|
|
2748
2764
|
|
|
@@ -2287,6 +2287,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|
|
2287
2287
|
return;
|
|
2288
2288
|
}
|
|
2289
2289
|
|
|
2290
|
+
p->buf_to_file->start = u->buffer.start;
|
|
2290
2291
|
p->buf_to_file->pos = u->buffer.start;
|
|
2291
2292
|
p->buf_to_file->last = u->buffer.pos;
|
|
2292
2293
|
p->buf_to_file->temporary = 1;
|
|
@@ -69,6 +69,8 @@ static ngx_int_t ngx_http_variable_request_method(ngx_http_request_t *r,
|
|
|
69
69
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
70
70
|
static ngx_int_t ngx_http_variable_remote_user(ngx_http_request_t *r,
|
|
71
71
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
72
|
+
static ngx_int_t ngx_http_variable_bytes_sent(ngx_http_request_t *r,
|
|
73
|
+
ngx_http_variable_value_t *v, uintptr_t data);
|
|
72
74
|
static ngx_int_t ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
|
|
73
75
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
74
76
|
static ngx_int_t ngx_http_variable_request_completion(ngx_http_request_t *r,
|
|
@@ -95,6 +97,11 @@ static ngx_int_t ngx_http_variable_sent_keep_alive(ngx_http_request_t *r,
|
|
|
95
97
|
static ngx_int_t ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r,
|
|
96
98
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
97
99
|
|
|
100
|
+
static ngx_int_t ngx_http_variable_connection(ngx_http_request_t *r,
|
|
101
|
+
ngx_http_variable_value_t *v, uintptr_t data);
|
|
102
|
+
static ngx_int_t ngx_http_variable_connection_requests(ngx_http_request_t *r,
|
|
103
|
+
ngx_http_variable_value_t *v, uintptr_t data);
|
|
104
|
+
|
|
98
105
|
static ngx_int_t ngx_http_variable_nginx_version(ngx_http_request_t *r,
|
|
99
106
|
ngx_http_variable_value_t *v, uintptr_t data);
|
|
100
107
|
static ngx_int_t ngx_http_variable_hostname(ngx_http_request_t *r,
|
|
@@ -212,6 +219,9 @@ static ngx_http_variable_t ngx_http_core_variables[] = {
|
|
|
212
219
|
|
|
213
220
|
{ ngx_string("remote_user"), NULL, ngx_http_variable_remote_user, 0, 0, 0 },
|
|
214
221
|
|
|
222
|
+
{ ngx_string("bytes_sent"), NULL, ngx_http_variable_bytes_sent,
|
|
223
|
+
0, 0, 0 },
|
|
224
|
+
|
|
215
225
|
{ ngx_string("body_bytes_sent"), NULL, ngx_http_variable_body_bytes_sent,
|
|
216
226
|
0, 0, 0 },
|
|
217
227
|
|
|
@@ -260,6 +270,12 @@ static ngx_http_variable_t ngx_http_core_variables[] = {
|
|
|
260
270
|
offsetof(ngx_http_request_t, limit_rate),
|
|
261
271
|
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
|
|
262
272
|
|
|
273
|
+
{ ngx_string("connection"), NULL,
|
|
274
|
+
ngx_http_variable_connection, 0, 0, 0 },
|
|
275
|
+
|
|
276
|
+
{ ngx_string("connection_requests"), NULL,
|
|
277
|
+
ngx_http_variable_connection_requests, 0, 0, 0 },
|
|
278
|
+
|
|
263
279
|
{ ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version,
|
|
264
280
|
0, 0, 0 },
|
|
265
281
|
|
|
@@ -1433,6 +1449,27 @@ ngx_http_variable_remote_user(ngx_http_request_t *r,
|
|
|
1433
1449
|
}
|
|
1434
1450
|
|
|
1435
1451
|
|
|
1452
|
+
static ngx_int_t
|
|
1453
|
+
ngx_http_variable_bytes_sent(ngx_http_request_t *r,
|
|
1454
|
+
ngx_http_variable_value_t *v, uintptr_t data)
|
|
1455
|
+
{
|
|
1456
|
+
u_char *p;
|
|
1457
|
+
|
|
1458
|
+
p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
|
|
1459
|
+
if (p == NULL) {
|
|
1460
|
+
return NGX_ERROR;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
v->len = ngx_sprintf(p, "%O", r->connection->sent) - p;
|
|
1464
|
+
v->valid = 1;
|
|
1465
|
+
v->no_cacheable = 0;
|
|
1466
|
+
v->not_found = 0;
|
|
1467
|
+
v->data = p;
|
|
1468
|
+
|
|
1469
|
+
return NGX_OK;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
|
|
1436
1473
|
static ngx_int_t
|
|
1437
1474
|
ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
|
|
1438
1475
|
ngx_http_variable_value_t *v, uintptr_t data)
|
|
@@ -1787,6 +1824,48 @@ ngx_http_variable_request_body_file(ngx_http_request_t *r,
|
|
|
1787
1824
|
}
|
|
1788
1825
|
|
|
1789
1826
|
|
|
1827
|
+
static ngx_int_t
|
|
1828
|
+
ngx_http_variable_connection(ngx_http_request_t *r,
|
|
1829
|
+
ngx_http_variable_value_t *v, uintptr_t data)
|
|
1830
|
+
{
|
|
1831
|
+
u_char *p;
|
|
1832
|
+
|
|
1833
|
+
p = ngx_pnalloc(r->pool, NGX_ATOMIC_T_LEN);
|
|
1834
|
+
if (p == NULL) {
|
|
1835
|
+
return NGX_ERROR;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
v->len = ngx_sprintf(p, "%uA", r->connection->number) - p;
|
|
1839
|
+
v->valid = 1;
|
|
1840
|
+
v->no_cacheable = 0;
|
|
1841
|
+
v->not_found = 0;
|
|
1842
|
+
v->data = p;
|
|
1843
|
+
|
|
1844
|
+
return NGX_OK;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
static ngx_int_t
|
|
1849
|
+
ngx_http_variable_connection_requests(ngx_http_request_t *r,
|
|
1850
|
+
ngx_http_variable_value_t *v, uintptr_t data)
|
|
1851
|
+
{
|
|
1852
|
+
u_char *p;
|
|
1853
|
+
|
|
1854
|
+
p = ngx_pnalloc(r->pool, NGX_INT_T_LEN);
|
|
1855
|
+
if (p == NULL) {
|
|
1856
|
+
return NGX_ERROR;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
v->len = ngx_sprintf(p, "%ui", r->connection->requests) - p;
|
|
1860
|
+
v->valid = 1;
|
|
1861
|
+
v->no_cacheable = 0;
|
|
1862
|
+
v->not_found = 0;
|
|
1863
|
+
v->data = p;
|
|
1864
|
+
|
|
1865
|
+
return NGX_OK;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
|
|
1790
1869
|
static ngx_int_t
|
|
1791
1870
|
ngx_http_variable_nginx_version(ngx_http_request_t *r,
|
|
1792
1871
|
ngx_http_variable_value_t *v, uintptr_t data)
|
|
@@ -474,8 +474,6 @@ ngx_process_get_status(void)
|
|
|
474
474
|
return;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
#if (NGX_SOLARIS || NGX_FREEBSD)
|
|
478
|
-
|
|
479
477
|
/*
|
|
480
478
|
* Solaris always calls the signal handler for each exited process
|
|
481
479
|
* despite waitpid() may be already called for this process.
|
|
@@ -491,8 +489,6 @@ ngx_process_get_status(void)
|
|
|
491
489
|
return;
|
|
492
490
|
}
|
|
493
491
|
|
|
494
|
-
#endif
|
|
495
|
-
|
|
496
492
|
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err,
|
|
497
493
|
"waitpid() failed");
|
|
498
494
|
return;
|
|
@@ -371,6 +371,8 @@ ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type)
|
|
|
371
371
|
|
|
372
372
|
ngx_pass_open_channel(cycle, &ch);
|
|
373
373
|
}
|
|
374
|
+
|
|
375
|
+
cpu_affinity = 0;
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
|
|
@@ -384,8 +386,8 @@ ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
|
|
|
384
386
|
manager = 0;
|
|
385
387
|
loader = 0;
|
|
386
388
|
|
|
387
|
-
path = ngx_cycle->
|
|
388
|
-
for (i = 0; i < ngx_cycle->
|
|
389
|
+
path = ngx_cycle->paths.elts;
|
|
390
|
+
for (i = 0; i < ngx_cycle->paths.nelts; i++) {
|
|
389
391
|
|
|
390
392
|
if (path[i]->manager) {
|
|
391
393
|
manager = 1;
|
|
@@ -1339,8 +1341,8 @@ ngx_cache_manager_process_handler(ngx_event_t *ev)
|
|
|
1339
1341
|
|
|
1340
1342
|
next = 60 * 60;
|
|
1341
1343
|
|
|
1342
|
-
path = ngx_cycle->
|
|
1343
|
-
for (i = 0; i < ngx_cycle->
|
|
1344
|
+
path = ngx_cycle->paths.elts;
|
|
1345
|
+
for (i = 0; i < ngx_cycle->paths.nelts; i++) {
|
|
1344
1346
|
|
|
1345
1347
|
if (path[i]->manager) {
|
|
1346
1348
|
n = path[i]->manager(path[i]->data);
|
|
@@ -1368,8 +1370,8 @@ ngx_cache_loader_process_handler(ngx_event_t *ev)
|
|
|
1368
1370
|
|
|
1369
1371
|
cycle = (ngx_cycle_t *) ngx_cycle;
|
|
1370
1372
|
|
|
1371
|
-
path = cycle->
|
|
1372
|
-
for (i = 0; i < cycle->
|
|
1373
|
+
path = cycle->paths.elts;
|
|
1374
|
+
for (i = 0; i < cycle->paths.nelts; i++) {
|
|
1373
1375
|
|
|
1374
1376
|
if (ngx_terminate || ngx_quit) {
|
|
1375
1377
|
break;
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nginxtra
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5.7
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-
|
|
12
|
+
date: 2012-11-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thor
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &19031520 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
@@ -21,7 +21,7 @@ dependencies:
|
|
|
21
21
|
version: 0.16.0
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *19031520
|
|
25
25
|
description: This gem is intended to provide an easy to use configuration file that
|
|
26
26
|
will automatically be used to compile nginx and configure the configuration.
|
|
27
27
|
email: reasonnumber@gmail.com
|