/index.php/ads and /index.php/xcx_sendmsg jump to the new service `` . ThankYouapiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress
namespace: my-ns
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
- my.cc
secretName: my-cc-certs
rules:
- host: my.cc
http:
paths:
# other path jump to the old service
- path: '/index.php/ads' '/index.php/xcx_sendmsg'
backend:
serviceName: new-service
servicePort: 8080
# - path: /index.php/xcx_sendmsg #like above
# backend:
# serviceName: new-service
# servicePort: 8080
@yangqinjiang you can do that repeating the sections.
i known that,but repeat is evil
i known that,but repeat is evil
Right, but that feature requires a change in the Ingress spec, something out of the scope of this project.
I was wondering the same thing and found this post. I have a feeling this will be a recurring subject.
is it working ??, i also want to use multiple path
Step:-1
Rather write multiple time,you can use like below in ingress file : (it is working for me)
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
{{- range .Values.backends }}
- path: "/movie-star-play/{{ .name }}/"
backend:
serviceName: {{ include "mvp-service.name" . }}
servicePort: http
{{- end }}
{{- end }}
Step:-2
then declare the "backends " in values file:
backends:
I wound up using annotation nginx.ingress.kubernetes.io/use-regex: "true" and then using regex at the path definition to avoid copy/pasta repetition for backend for each individual path. e.g.:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: productpage-ingress
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: books.minikube.local
http:
paths:
- path: /(productpage|static|login|logout).*
backend:
serviceName: myservice
servicePort: 9080
Most helpful comment
I wound up using annotation
nginx.ingress.kubernetes.io/use-regex: "true"and then using regex at the path definition to avoid copy/pasta repetition for backend for each individual path. e.g.: