Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Created July 28, 2020 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlessanagustin/2138bbeb6414245f54e9344bd0e51572 to your computer and use it in GitHub Desktop.
Save carlessanagustin/2138bbeb6414245f54e9344bd0e51572 to your computer and use it in GitHub Desktop.
Kubernetes Ingress path redirection
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-path
annotations:
kubernetes.io/ingress.class: internal
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- http:
paths:
- backend:
serviceName: target-service
servicePort: 80
path: /my-path(/|$)(.*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment