@@ -16,7 +16,7 @@ certificate management ([ACMEv2]) protocol.
16
16
17
17
### Requirements
18
18
19
- - Regular NGINX build dependencies: C compliler , make, PCRE2, Zlib
19
+ - Regular NGINX build dependencies: C compiler , make, PCRE2, Zlib
20
20
- System-wide installation of OpenSSL 1.1.1 or later
21
21
- Rust toolchain (1.81.0 or later)
22
22
- [ libclang] for rust-bindgen
@@ -25,11 +25,11 @@ certificate management ([ACMEv2]) protocol.
25
25
26
26
### Building
27
27
28
- One way to build the module is to export a path to a pre-built nginx source
28
+ One way to build the module is to export a path to a pre-built NGINX source
29
29
tree and run ` cargo ` .
30
30
31
31
``` sh
32
- # checkout, configure and build nginx at ../nginx
32
+ # checkout, configure and build NGINX at ../nginx
33
33
cd nginx-acme
34
34
export NGINX_BUILD_DIR=$( realpath ../nginx/objs)
35
35
cargo build --release
@@ -40,7 +40,7 @@ The result will be located at `target/release/libnginx_acme.so`.
40
40
Another way is to use the provided config script:
41
41
42
42
``` sh
43
- # in the nginx source directory
43
+ # in the NGINX source directory
44
44
auto/configure \
45
45
--with-compat \
46
46
--with-http_ssl_module \
@@ -52,9 +52,29 @@ The result will be located at `objs/ngx_http_acme_module.so`.
52
52
Currently this method produces a slightly larger library, as we don't instruct
53
53
the linker to perform LTO and remove unused code.
54
54
55
+ ### Testing
56
+
57
+ The repository contains an integration test suite based on the [ nginx-tests] .
58
+ The following command will build the module and run the tests:
59
+
60
+ ``` sh
61
+ # Path to the nginx source checkout, defaults to ../nginx if not specified.
62
+ export NGINX_SOURCE_DIR=$( realpath ../nginx)
63
+ # Path to the nginx-tests checkout; defaults to ../nginx/tests if not specified.
64
+ export NGINX_TESTS_DIR=$( realpath ../nginx-tests)
65
+
66
+ make test
67
+ ```
68
+
69
+ Most of the tests require [ pebble] test server binary in the path, or in a
70
+ location specified via ` TEST_NGINX_PEBBLE_BINARY ` environment variable.
71
+
72
+ [ nginx-tests ] : https://github.com/nginx/nginx-tests
73
+ [ pebble ] : https://github.com/letsencrypt/pebble
74
+
55
75
## How to Use
56
76
57
- Add the module to the nginx configuration and configure as described below.
77
+ Add the module to the NGINX configuration and configure as described below.
58
78
Note that this module requires a [ resolver] configuration in the ` http ` block.
59
79
60
80
[ resolver ] : https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
@@ -66,12 +86,12 @@ resolver 127.0.0.1:53;
66
86
67
87
acme_issuer example {
68
88
uri https://acme.example.com/directory;
69
-
70
- state_path /var/lib /nginx/acme-example;
89
+
90
+ state_path /var/cache /nginx/acme-example;
71
91
accept_terms_of_service;
72
92
}
73
93
74
- acme_shared_zone zone=acme_shared :1M;
94
+ acme_shared_zone zone=ngx_acme_shared :1M;
75
95
76
96
server {
77
97
listen 443 ssl;
@@ -82,6 +102,7 @@ server {
82
102
ssl_certificate $acme_certificate;
83
103
ssl_certificate_key $acme_certificate_key;
84
104
105
+ # do not parse the certificate on each request
85
106
ssl_certificate_cache max=2;
86
107
}
87
108
@@ -171,7 +192,7 @@ the certificate of the ACME server.
171
192
172
193
** Context:** acme_issuer
173
194
174
- Enables or disables verification of the ACME servier certificate.
195
+ Enables or disables verification of the ACME server certificate.
175
196
176
197
### state_path
177
198
@@ -215,6 +236,9 @@ the module.
215
236
The shared memory zone will be used to store the issued certificates, keys and
216
237
challenge data for all the configured certificate issuers.
217
238
239
+ The default zone size is sufficient to hold ~ 50 ECDSA prime256v1 keys or
240
+ ~ 35 RSA 2048 keys.
241
+
218
242
### acme_certificate
219
243
220
244
** Syntax:** acme_certificate ` issuer ` [ ` identifier ` ...] [ ` key ` = ` alg[:size] ` ]
@@ -245,12 +269,12 @@ The `ngx_http_acme_module` module defines following embedded
245
269
variables, valid in the ` server ` block with the
246
270
[ acme_certificate] ( #acme_certificate ) directive:
247
271
248
- ### `` $acme_certificate ` `
272
+ ### ` $acme_certificate `
249
273
250
274
SSL certificate that can be passed to the
251
275
[ ssl_certificate] ( https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate ) .
252
276
253
- ### `` $acme_certificate_key ` `
277
+ ### ` $acme_certificate_key `
254
278
255
279
SSL certificate private key that can be passed to the
256
280
[ ssl_certificate_key] ( https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key ) .
0 commit comments