Azure-docs: Static Resources will be loaded from wrong Application

Created on 5 Nov 2018  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-docs

Description

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.

Summary

Current Behavior

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

Wanted behavior:

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

Reqested Actions

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.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author container-servicsvc doc-enhancement triaged

All 6 comments

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

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monteledwards picture monteledwards  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments