@@ -16,7 +16,7 @@ certificate management ([ACMEv2]) protocol.
1616
1717### Requirements
1818
19- - Regular NGINX build dependencies: C compliler , make, PCRE2, Zlib
19+ - Regular NGINX build dependencies: C compiler , make, PCRE2, Zlib
2020- System-wide installation of OpenSSL 1.1.1 or later
2121- Rust toolchain (1.81.0 or later)
2222- [ libclang] for rust-bindgen
@@ -25,11 +25,11 @@ certificate management ([ACMEv2]) protocol.
2525
2626### Building
2727
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
2929tree and run ` cargo ` .
3030
3131``` sh
32- # checkout, configure and build nginx at ../nginx
32+ # checkout, configure and build NGINX at ../nginx
3333cd nginx-acme
3434export NGINX_BUILD_DIR=$( realpath ../nginx/objs)
3535cargo build --release
@@ -40,7 +40,7 @@ The result will be located at `target/release/libnginx_acme.so`.
4040Another way is to use the provided config script:
4141
4242``` sh
43- # in the nginx source directory
43+ # in the NGINX source directory
4444auto/configure \
4545 --with-compat \
4646 --with-http_ssl_module \
@@ -52,9 +52,29 @@ The result will be located at `objs/ngx_http_acme_module.so`.
5252Currently this method produces a slightly larger library, as we don't instruct
5353the linker to perform LTO and remove unused code.
5454
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+
5575## How to Use
5676
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.
5878Note that this module requires a [ resolver] configuration in the ` http ` block.
5979
6080[ resolver ] : https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
@@ -66,12 +86,12 @@ resolver 127.0.0.1:53;
6686
6787acme_issuer example {
6888 uri https://acme.example.com/directory;
69- 70- state_path /var/lib /nginx/acme-example;
89+ 90+ state_path /var/cache /nginx/acme-example;
7191 accept_terms_of_service;
7292}
7393
74- acme_shared_zone zone=acme_shared :1M;
94+ acme_shared_zone zone=ngx_acme_shared :1M;
7595
7696server {
7797 listen 443 ssl;
@@ -82,6 +102,7 @@ server {
82102 ssl_certificate $acme_certificate;
83103 ssl_certificate_key $acme_certificate_key;
84104
105+ # do not parse the certificate on each request
85106 ssl_certificate_cache max=2;
86107}
87108
@@ -171,7 +192,7 @@ the certificate of the ACME server.
171192
172193** Context:** acme_issuer
173194
174- Enables or disables verification of the ACME servier certificate.
195+ Enables or disables verification of the ACME server certificate.
175196
176197### state_path
177198
@@ -215,6 +236,9 @@ the module.
215236The shared memory zone will be used to store the issued certificates, keys and
216237challenge data for all the configured certificate issuers.
217238
239+ The default zone size is sufficient to hold ~ 50 ECDSA prime256v1 keys or
240+ ~ 35 RSA 2048 keys.
241+
218242### acme_certificate
219243
220244** Syntax:** acme_certificate ` issuer ` [ ` identifier ` ...] [ ` key ` = ` alg[:size] ` ]
@@ -245,12 +269,12 @@ The `ngx_http_acme_module` module defines following embedded
245269variables, valid in the ` server ` block with the
246270[ acme_certificate] ( #acme_certificate ) directive:
247271
248- ### `` $acme_certificate ` `
272+ ### ` $acme_certificate `
249273
250274SSL certificate that can be passed to the
251275[ ssl_certificate] ( https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate ) .
252276
253- ### `` $acme_certificate_key ` `
277+ ### ` $acme_certificate_key `
254278
255279SSL certificate private key that can be passed to the
256280[ ssl_certificate_key] ( https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key ) .
0 commit comments