You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/nginx-ingress/main.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -142,8 +142,8 @@ var (
142
142
`The timeout in milliseconds which the Ingress Controller will wait for a successful NGINX reload after a change or at the initial start. (default 60000)`)
`A Secret with a TLS certificate and key for TLS termination of every Ingress host for which TLS termination is enabled but the Secret is not specified.
146
-
Format: <namespace>/<name>. If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
145
+
`A Secret with a TLS certificate and key for TLS termination of every Ingress/VirtualServer host for which TLS termination is enabled but the Secret is not specified.
146
+
Format: <namespace>/<name>. If the argument is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection.
147
147
If the argument is set, but the Ingress controller is not able to fetch the Secret from Kubernetes API, the Ingress controller will fail to start.`)
`controller.defaultTLS.cert` | The base64-encoded TLS certificate for the default HTTPS server. If not specified, a pre-generated self-signed certificate is used. **Note:** It is recommended that you specify your own certificate. | A pre-generated self-signed certificate.
163
163
`controller.defaultTLS.key` | The base64-encoded TLS key for the default HTTPS server. **Note:** If not specified, a pre-generated key is used. It is recommended that you specify your own key. | A pre-generated key.
164
164
`controller.defaultTLS.secret` | The secret with a TLS certificate and key for the default HTTPS server. The value must follow the following format: `<namespace>/<name>`. Used as an alternative to specifying a certificate and key using `controller.defaultTLS.cert` and `controller.defaultTLS.key` parameters. | None
165
-
`controller.wildcardTLS.cert` | The base64-encoded TLS certificate for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. | None
166
-
`controller.wildcardTLS.key` | The base64-encoded TLS key for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. | None
167
-
`controller.wildcardTLS.secret` | The secret with a TLS certificate and key for every Ingress host that has TLS enabled but no secret specified. The value must follow the following format: `<namespace>/<name>`. Used as an alternative to specifying a certificate and key using `controller.wildcardTLS.cert` and `controller.wildcardTLS.key` parameters. | None
165
+
`controller.wildcardTLS.cert` | The base64-encoded TLS certificate for every Ingress/VirtualServer host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection. | None
166
+
`controller.wildcardTLS.key` | The base64-encoded TLS key for every Ingress/VirtualServer host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection. | None
167
+
`controller.wildcardTLS.secret` | The secret with a TLS certificate and key for every Ingress/VirtualServer host that has TLS enabled but no secret specified. The value must follow the following format: `<namespace>/<name>`. Used as an alternative to specifying a certificate and key using `controller.wildcardTLS.cert` and `controller.wildcardTLS.key` parameters. | None
168
168
`controller.nodeSelector` | The node selector for pod assignment for the Ingress controller pods. | {}
169
169
`controller.terminationGracePeriodSeconds` | The termination grace period of the Ingress controller pod. | 30
170
170
`controller.tolerations` | The tolerations of the Ingress controller pods. | []
Copy file name to clipboardExpand all lines: docs/content/configuration/global-configuration/command-line-arguments.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,9 +38,9 @@ Format: `<namespace>/<name>`
38
38
39
39
### -wildcard-tls-secret `<string>`
40
40
41
-
A Secret with a TLS certificate and key for TLS termination of every Ingress host for which TLS termination is enabled but the Secret is not specified.
41
+
A Secret with a TLS certificate and key for TLS termination of every Ingress/VirtualServer host for which TLS termination is enabled but the Secret is not specified.
42
42
43
-
* If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
43
+
* If the argument is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection.
44
44
45
45
* If the argument is set, but the Ingress controller is not able to fetch the Secret from Kubernetes API, the Ingress controller will fail to start.
Copy file name to clipboardExpand all lines: docs/content/configuration/virtualserver-and-virtualserverroute-resources.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ redirect:
73
73
{{% table %}}
74
74
|Field | Description | Type | Required |
75
75
| ---| ---| ---| --- |
76
-
|``secret`` | The name of a secret with a TLS certificate and key. The secret must belong to the same namespace as the VirtualServer. The secret must be of the type ``kubernetes.io/tls`` and contain keys named ``tls.crt`` and ``tls.key`` that contain the certificate and private key as described [here](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). If the secret doesn't exist or is invalid, NGINX will break any attempt to establish a TLS connection to the host of the VirtualServer. | ``string`` | No |
76
+
|``secret`` | The name of a secret with a TLS certificate and key. The secret must belong to the same namespace as the VirtualServer. The secret must be of the type ``kubernetes.io/tls`` and contain keys named ``tls.crt`` and ``tls.key`` that contain the certificate and private key as described [here](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). If the secret doesn't exist or is invalid, NGINX will break any attempt to establish a TLS connection to the host of the VirtualServer. If the secret is not specified but [wildcard TLS secret](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-wildcard-tls-secret) is configured, NGINX will use the wildcard secret for TLS termination. | ``string`` | No |
77
77
|``redirect`` | The redirect configuration of the TLS for a VirtualServer. | [tls.redirect](#virtualservertlsredirect) | No | ### VirtualServer.TLS.Redirect |
Copy file name to clipboardExpand all lines: docs/content/installation/installation-with-helm.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,9 +168,9 @@ The following tables lists the configurable parameters of the NGINX Ingress cont
168
168
|``controller.defaultTLS.cert``| The base64-encoded TLS certificate for the default HTTPS server. If not specified, a pre-generated self-signed certificate is used. **Note:** It is recommended that you specify your own certificate. | A pre-generated self-signed certificate. |
169
169
|``controller.defaultTLS.key``| The base64-encoded TLS key for the default HTTPS server. **Note:** If not specified, a pre-generated key is used. It is recommended that you specify your own key. | A pre-generated key. |
170
170
|``controller.defaultTLS.secret``| The secret with a TLS certificate and key for the default HTTPS server. The value must follow the following format: ``<namespace>/<name>``. Used as an alternative to specifying a certificate and key using ``controller.defaultTLS.cert`` and ``controller.defaultTLS.key`` parameters. | None |
171
-
|``controller.wildcardTLS.cert``| The base64-encoded TLS certificate for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. | None |
172
-
|``controller.wildcardTLS.key``| The base64-encoded TLS key for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. | None |
173
-
|``controller.wildcardTLS.secret``| The secret with a TLS certificate and key for every Ingress host that has TLS enabled but no secret specified. The value must follow the following format: ``<namespace>/<name>``. Used as an alternative to specifying a certificate and key using ``controller.wildcardTLS.cert`` and ``controller.wildcardTLS.key`` parameters. | None |
171
+
|``controller.wildcardTLS.cert``| The base64-encoded TLS certificate for every Ingress/VirtualServer host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection. | None |
172
+
|``controller.wildcardTLS.key``| The base64-encoded TLS key for every Ingress/VirtualServer host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress/VirtualServer hosts NGINX will break any attempt to establish a TLS connection. | None |
173
+
|``controller.wildcardTLS.secret``| The secret with a TLS certificate and key for every Ingress/VirtualServer host that has TLS enabled but no secret specified. The value must follow the following format: ``<namespace>/<name>``. Used as an alternative to specifying a certificate and key using ``controller.wildcardTLS.cert`` and ``controller.wildcardTLS.key`` parameters. | None |
174
174
|``controller.nodeSelector``| The node selector for pod assignment for the Ingress controller pods. | {} |
175
175
|``controller.terminationGracePeriodSeconds``| The termination grace period of the Ingress controller pod. | 30 |
176
176
|``controller.tolerations``| The tolerations of the Ingress controller pods. |[]|
The wildcard TLS certificate simplifies the configuration of TLS termination if you need to use the same TLS certificate in multiple Ingress resources from various namespaces. Typically, such a certificate is for a subdomain (for example, `*.example.com`), while the hosts in the Ingress resources include that subdomain (for example, `foo.example.com`, `bar.example.com`).
3
+
The wildcard TLS certificate simplifies the configuration of TLS termination if you need to use the same TLS certificate in multiple Ingress and VirtualServer resources from various namespaces. Typically, such a certificate is for a subdomain (for example, `*.example.com`), while the hosts in the Ingress and VirtualServer resources include that subdomain (for example, `foo.example.com`, `bar.example.com`).
4
4
5
5
## Example
6
6
7
7
### Prerequisites
8
8
9
-
Start the Ingress Controller with the `-wildcard-tls-secret`[command-line argument](https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/command-line-arguments/) set to a TLS secret with a wildcard cert/key. For example:
9
+
Start the Ingress Controller with the `-wildcard-tls-secret`[command-line argument](https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/command-line-arguments/#cmdoption-wildcard-tls-secret) set to a TLS secret with a wildcard cert/key. For example:
@@ -16,16 +16,16 @@ Start the Ingress Controller with the `-wildcard-tls-secret` [command-line argum
16
16
17
17
### Configuring TLS Termination
18
18
19
-
In the example below we configure TLS termination for two Ingress resources for the hosts`foo.example.com` and `bar.example.com` respectively:
19
+
In the example below we configure TLS termination for an Ingress for the host`foo.example.com` and a VirtualServer for the host `bar.example.com`:
20
20
21
-
`foo-ingress`from the namespace `foo-namespace`:
21
+
`foo` Ingress from the namespace `foo`:
22
22
23
23
```yaml
24
24
apiVersion: networking.k8s.io/v1
25
25
kind: Ingress
26
26
metadata:
27
-
name: foo-ingress
28
-
namespace: foo-namespace
27
+
name: foo
28
+
namespace: foo
29
29
annotati
6D4F
ons:
30
30
kubernetes.io/ingress.class: "nginx"
31
31
spec:
@@ -45,31 +45,26 @@ spec:
45
45
number: 80
46
46
```
47
47
48
-
`bar-ingress` from the namespace `bar-namespace`:
48
+
`bar` VirtualServer from the namespace `bar`:
49
49
50
50
```yaml
51
-
apiVersion: networking.k8s.io/v1
52
-
kind: Ingress
51
+
apiVersion: k8s.nginx.org/v1
52
+
kind: VirtualServer
53
53
metadata:
54
-
name: bar-ingress
55
-
namespace: bar-namespace
56
-
annotations:
57
-
kubernetes.io/ingress.class: "nginx"
54
+
name: bar
55
+
namespace: bar
58
56
spec:
57
+
host: bar.example.com
59
58
tls:
60
-
- hosts:
61
-
- bar.example.com
62
-
rules:
63
-
- host: bar.example.com
64
-
http:
65
-
paths:
66
-
- path: /
67
-
pathType: Prefix
68
-
backend:
69
-
service:
70
-
name: bar-service
71
-
port:
72
-
number: 80
59
+
secret: ""
60
+
upstreams:
61
+
- name: bar
62
+
service: bar-service
63
+
port: 80
64
+
routes:
65
+
- path: /
66
+
action:
67
+
pass: bar
73
68
```
74
69
75
-
Because we don't reference any TLS secret in the `tls` section (there is no `secretName` field) in both Ingress resources, NGINX will use the wildcard secret specified in the `-wildcard-tls-secret` command-line argument.
70
+
Because we don't reference any TLS secret in the resources above -- there is no `secret` field in the `tls` section of the Ingress resource and the `secret` field is empty in the VirtualServer -- NGINX will use the wildcard secret specified in the `-wildcard-tls-secret` command-line argument.
0 commit comments