added another documentation example

This commit is contained in:
Stefan Iuga 2021-09-06 20:06:39 +03:00
parent 9f9122c381
commit 892270346b
2 changed files with 19 additions and 1 deletions

View file

@ -18,6 +18,14 @@ 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:

View file

@ -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