0

In my application I am using ingress/nginix its conflicts my backend API route.

ingress file contains default UI route using regex

/()(.*)

Above is default route and based on it it loads default page of UI UI route - /management

At backend .Net controller level I have route prefix like in b /api/management

For backend API, In ingress I have defined route like /api/management()(.*)

UI is rendered from /management route from management-ui-service While calling backend API from UI we are calling backend api endpoints with http://domain/api/management/XXXX

It returns 404 with above API path,but while we call API with http://domain/api/management/api/management/XXXX (need to pass multiple time end point - /api/management) it works

How we can call it with single endpoint like http://domain/api/management/XXXX

enter image description here

1 Answers1

0

This may be well related to regex in path put there for no good reason.
I use ingress this way and so far it works exactly as I expect it:

- backend:
    service:
      name: app-api
      port:
        number: 80
  path: /api-manage/
  pathType: Prefix

- backend:
    service:
      name: app-ui
      port:
        number: 80
  path: /manage/
  pathType: Prefix

This way I can refer to https://api.mysite.io/manage or https://api.mysite.io/api-manage/ and land exactly where I'm supposed to.
Yes, it is formatted different than your example, but you should be able to adapt it to your configuration.

Randych
  • 56
  • 5