additional info for the custom-headers documentation page (#7603)
* added another documentation example
* added end of file newline
* Revert "added end of file newline"
This reverts commit 2d196ffba3
.
* added another documentation example
This commit is contained in:
parent
260910c0a0
commit
5c6a28464b
2 changed files with 19 additions and 1 deletions
|
@ -18,7 +18,15 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main
|
|||
|
||||
The nginx ingress controller will read the `ingress-nginx/ingress-nginx-controller` ConfigMap, find the `proxy-set-headers` key, read HTTP headers from the `ingress-nginx/custom-headers` ConfigMap, and include those HTTP headers in all requests flowing from nginx to the backends.
|
||||
|
||||
|
||||
The above example was for passing a custom list of headers to the upstream server.
|
||||
To pass the custom headers before sending response traffic to the client, use the add-headers key:
|
||||
|
||||
```console
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/customization/custom-headers/configmap-client-response.yaml
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
Check the contents of the ConfigMaps are present in the nginx.conf file using:
|
||||
`kubectl exec ingress-nginx-controller-873061567-4n3k2 -n ingress-nginx -- cat /etc/nginx/nginx.conf`
|
||||
`kubectl exec ingress-nginx-controller-873061567-4n3k2 -n ingress-nginx -- cat /etc/nginx/nginx.conf`
|
|
@ -0,0 +1,10 @@
|
|||
apiVersion: v1
|
||||
data:
|
||||
add-headers: "ingress-nginx/custom-headers"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ingress-nginx-controller
|
||||
namespace: ingress-nginx
|
||||
labels:
|
||||
app.kubernetes.io/name: ingress-nginx
|
||||
app.kubernetes.io/part-of: ingress-nginx
|
Loading…
Reference in a new issue