Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebar value injection refactor necessary to prevent unstyled content and missing images on missing env var #38

Open
hotspoons opened this issue Sep 25, 2022 · 1 comment

Comments

@hotspoons
Copy link

This and this - the leading slash in the template causes this to occur when RENDER_PATH_PREFIX is undefined and the context root of the application is not / (e.g. this container is deployed to a path behind a LB on a route):

image

I suggest adding the slash at the end of the injected env var here:

'/' + process.env.RENDER_PATH_PREFIX.replace(/^[\\/]+/, '').replace(/[\\/]+$/, '') :
- a trailing slash, even if redundant should not affect route resolution, so it would be a safer default IMO.

@ngaffa
Copy link

ngaffa commented May 12, 2023

I succeed to do it by adding the env variable :

  • name: RENDER_PATH_PREFIX
    value: [yourPathprefix]
    And it work with an nginx ingress :
    Annotation:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/configuration-snippet: |
    rewrite ^(/[yourPathprefix])$ $1/ redirect;
    nginx.ingress.kubernetes.io/rewrite-target: /$2

And in your backend something like this :

  • backend:
    service:
    name: demo-svc
    port:
    number: 80
    path: /yourPathprefix(.*)
    pathType: Prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants