resource pathing behind nginix ingress
See original GitHub issueWe’re attempting to run a dotvvm site in Kubernetes behind a Nginx ingress.
while everything works locally, even if run from a docker container, when running behind the ingress we’re seeing issues where the site wont load.
its specifically failing trying to find a ‘dotvvm–internal’ script at the (example) url https://myCoolURLhere.com/dotvvmResource/jUwMRn0laxpYA4BX1REy/dotvvm--internal behind the ingress the path should be https://myCoolURLhere.com/assessments/dotvvmResource/jUwMRn0laxpYA4BX1REy/dotvvm--internal
We were originally also having problems getting bootstrap and our css to load, changing from the following
config.Resources.Register("bootstrap-css", new StylesheetResource() { Location = new UrlResourceLocation("~/Content/bootstrap.min.css") });
to
config.Resources.Register("bootstrap-css", new StylesheetResource() { Location = new UrlResourceLocation("./Content/bootstrap.min.css") });
fixes the pathing to bootstrap, and the css files when behind the ingress.
Is there a property or configuration setting I can adjust so that it looks for the dotvvm–internal script with the appropriate ingress path included ?
Thanks.
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
I was able to get it running with a combination of ingress (without rewriting) and
UsePathBase
:ingress.yaml
Startup.cs
Are you using rewrite rule on the ingress to remove the
/assessments
segment? I think this would be the problem - the app needs to know it is running in a virtual directory so it would generate the URLs correctly.I’m closing this, I assume it worked. Please reopen or open a new issue if the problem persists