The provided example just works because one service is provided under the root-path "/" and the second is provided under "/hello-world-two". If you would provide the second first service not under "/" but instead under "/hello-world-one" static resources would not be loaded.
This is because the applications render for example "<link rel="stylesheet" type="text/css" href="/static/default.css">" which will always use the application under the root "/" path. So the application under "hello-world-two" actually uses the static resources of "hello-world-one" ("/"), which is not correct.
Request Browser (host.com/hello-world-two) -> AppGateway -> Internal LB -> IngressController -> Service under /hello.world-two
Response:
...
<link rel="stylesheet" type="text/css" href="/static/default.css">
...
Browser will load resources:
Browser (host.com/static/default.css) -> AppGateway -> Internal LB -> IngressController -> Service Under Root
Request Browser (host.com/hello-world-two) -> AppGateway -> Internal LB -> IngressController -> Service under /hello-world-two
Response:
...
<link rel="stylesheet" type="text/css" href="hello-world-two/static/default.css">
...
Browser will load resources:
Browser (host.com/hello-world-two/static/default.css) -> AppGateway -> Internal LB -> IngressController -> Service Under Root
Could you please provide a way how nginx-ingress-controller could be configured to solve the problem that I described above, so the example would resemble a more realistic use-case.
Note that just setting the the add-base-url property in the ingress-controller will not work, because the ingress controller will use the internal IP in the HTML base tag which will not be resolvable from public Internet. A solution where you could configure the base-tag or sth. similar would be preferred.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! We are currently investigating and will update you shortly.
@PIaH I have assigned the issue to the content author to investigate further and update the document as appropriate.
@MicahMcKittrick-MSFT
Any update here?
The issue still seems to be open.
@iainfoulds any update on this?
Not a prioritized request, but something we have in our backlog. No ETA on when this content may be published.
@PeterIttner take a look at the example here which should be able to use to solve your problem:
https://docs.microsoft.com/azure/application-gateway/ingress-controller-annotations#backend-path-prefix