|
5 | 5 | - [Docker Networking](#docker-networking)
|
6 | 6 | - [Upstream (Backend) features](#upstream-backend-features)
|
7 | 7 | - [Basic Authentication Support](#basic-authentication-support)
|
| 8 | +- [mTLS client side certificate authentication](#mtls-client-side-certificate-authentication) |
8 | 9 | - [Logging](#logging)
|
9 | 10 | - [SSL Support](#ssl-support)
|
10 | 11 | - [IPv6 Support](#ipv6-nat)
|
@@ -374,6 +375,36 @@ You'll need apache2-utils on the machine where you plan to create the htpasswd f
|
374 | 375 |
|
375 | 376 | ⬆️ [back to table of contents](#table-of-contents)
|
376 | 377 |
|
| 378 | +## mTLS client side certificate authentication |
| 379 | +In mTLS, both the client and server have a certificate, and both sides authenticate using their public/private key pair. |
| 380 | +A "root" TLS certificate is necessary for mTLS; this enables an organization to be their own certificate authority. The certificates used by authorized clients and servers have to correspond to this root certificate. The root certificate is self-signed, meaning that the organization creates it themselves. |
| 381 | +Make sure you have a root certificate (CA) and client public/private key pair. There is a [howto in the wiki](https://github.com/nginx-proxy/nginx-proxy/wiki/mTLS-client-side-certificate-authentication). |
| 382 | + |
| 383 | +### Certificate Authority (CA) |
| 384 | +#### Per-VIRTUAL_HOST CA |
| 385 | +In order to secure a virtual host, you have to copy your CA certificate file (ca.crt) named as its equivalent `VIRTUAL_HOST` variable or if `VIRTUAL_HOST` is a regex, after the sha1 hash of the regex with the suffix `.ca.crt` in directory |
| 386 | +`/etc/nginx/certs/`. Example: `/etc/nginx/certs/app.example.com.ca.crt`. |
| 387 | +Or if your `VIRTUAL_HOST` is a regex: `/etc/nginx/certs/9ae5d1b655182b052fed458ec701f9ae1524e1c2.ca.crt`. |
| 388 | + |
| 389 | +#### Global CA |
| 390 | +If you want to secure everything globally you can copy your CA certificate file (ca.crt) named as `ca.crt` in directory |
| 391 | +`/etc/nginx/certs/`. Example: `/etc/nginx/certs/ca.crt`. |
| 392 | + |
| 393 | +### Certificate Revocation List (CRL) |
| 394 | +#### Per-VIRTUAL_HOST CRL |
| 395 | +In order to use a certificate revocation list, you have to copy your CRL file named as its equivalent `VIRTUAL_HOST` variable or if `VIRTUAL_HOST` is a regex, after the sha1 hash of the regex with the suffix `.crl.pem` in directory |
| 396 | +`/etc/nginx/certs/`. Example: `/etc/nginx/certs/app.example.com.crl.pem`. |
| 397 | +Or if your `VIRTUAL_HOST` is a regex: `/etc/nginx/certs/9ae5d1b655182b052fed458ec701f9ae1524e1c2.crl.pem`. |
| 398 | + |
| 399 | +#### Global CRL |
| 400 | +If you want to use a global CRL file you have to copy your CRL file named as `ca.crl.pem` in directory |
| 401 | +`/etc/nginx/certs/`. Example: `/etc/nginx/certs/ca.crl.pem`. |
| 402 | + |
| 403 | +### optional ssl_verify_client |
| 404 | +Optional [`ssl_verify_client`](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_verify_client) can be activated by using the `com.github.nginx-proxy.nginx-proxy.ssl_verify_client: "optional"` label on a proxied container. If this label is set on a proxied container access is not blocked but the result of the mTLS verify is stored in the [$ssl_client_verify](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#var_ssl_client_verify) variable which you can use this in the [Per-VIRTUAL_HOST location](https://github.com/nginx-proxy/nginx-proxy/tree/main/docs#per-virtual_host-location-configuration) and [Per-VIRTUAL_PATH location](https://github.com/nginx-proxy/nginx-proxy/tree/main/docs#per-virtual_path-location-configuration) configurations. |
| 405 | + |
| 406 | +⬆️ [back to table of contents](#table-of-contents) |
| 407 | + |
377 | 408 | ## Logging
|
378 | 409 |
|
379 | 410 | The default nginx access log format is
|
@@ -1327,6 +1358,7 @@ Configuration available on each proxied container, either by environment variabl
|
1327 | 1358 | | n/a | [`com.github.nginx-proxy.nginx-proxy.non-get-redirect`](#how-ssl-support-works) | global (proxy) value |
|
1328 | 1359 | | [`SERVER_TOKENS`](#per-virtual_host-server_tokens-configuration) | n/a | no default value |
|
1329 | 1360 | | [`SSL_POLICY`](#how-ssl-support-works) | n/a | global (proxy) value |
|
| 1361 | +| n/a | [`com.github.nginx-proxy.nginx-proxy.ssl_verify_client`](#optional-ssl_verify_client) | `on` | |
1330 | 1362 | | n/a | [`com.github.nginx-proxy.nginx-proxy.trust-default-cert`](#default-and-missing-certificate) | global (proxy) value |
|
1331 | 1363 | | [`VIRTUAL_DEST`](#virtual_dest) | n/a | `empty string` |
|
1332 | 1364 | | [`VIRTUAL_HOST`](#virtual-hosts-and-ports) | n/a | no default value |
|
|
0 commit comments