Handlebar value injection refactor necessary to prevent unstyled content and missing images on missing env var
hotspoons opened this issue · 1 comments
hotspoons commented
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):
I suggest adding the slash at the end of the injected env var here:
hello-kubernetes/src/app/server.js
Line 22 in 6e9ac0e
ngaffa commented
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