I have .net Framework(4.6) based Web API service. i am hosting them in azure AKS.
I am using nignix and written Ingress Rule like this.
host: abc.com
http:
paths:
- path: /EmailAPI
backend:
serviceName: esolvitemailapi-svc
servicePort: 80
Now My web api is expecting URl
http://service/api/controller/action
But i think Ingres in sending the URI as
http://service/EmailAPI/api/controller/action
and i am getting 404 Error.
what is the best way to handle it. i don't want to do code change by doing [RoutePrefix("IdentityAPI/api")]
there are couple of apis and its big solution so it may break.
is there any think i can handle it at configuration level.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-dev-backend
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: api.dev.arytic.com
http:
paths:
- backend:
serviceName: esolvitidentityapi-svc
servicePort: 80
path: /IdentityAPI(/|$)(.*)