Return Custom Response Headers with Kubernetes Ingress

kubernetes
2024-02-23 03:38 (2 years ago)
Headers on the Line
Play a song themed on this article

How to Return Custom Response Headers with Nginx Ingress in Kubernetes

This is useful when you want to check which Ingress is responding among multiple Ingresses.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ...
  namespace: ...
  annotations:
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "X-Ingress-Name: my-awesome-ingress";
      more_set_headers "X-Other-header: other-header";
spec:

Categories

Archive