Running Redis UI on a subdirectory
vojtechzicha opened this issue · 10 comments
Hi,
I've tried deploying Redis UI to Kubernetes Ingress and I've stumbled upon an issue running on non-root path.
When published via following definition:
- path: /redis/(.*)
backend:
serviceName: redis-ui
servicePort: 7843
The application loads on https://example.com/redis/
, but the JS and page itself still loads as https://example.com/bundle.js
.
Usually in similar docker apps, there is an environment variable that can provide the path, but I cannot find any in this project.
Is there a way to run the app on non-root path?
If there is a hint where to do the change in code, I can try doing pull request but haven't find the right place, so any hints would be welcomed too.
it is a big refactor, i am not sure if i am going to implement, feature request is welcome....
you are easier to use a subdomain redis.example.com etc...
@vojtechzicha If you use ingress-nginx you can use it to rewrite urls on routing
You have to add annotation to ingress
nginx.ingress.kubernetes.io/rewrite-target: /$2
And create path like this
- path: /myroute(/|$)(.*)
backend:
serviceName: myservice
servicePort: http
Nginx will receive /myroute
routes, rewrite them as they are /
and pass to specified service
I can't get nginx rewrite working.
Sorry my client side dev skills are limited, but is it not possible to add the following to here?
<base href="./">
I can't get nginx rewrite working.
Sorry my client side dev skills are limited, but is it not possible to add the following to here?
<base href="./">
nope, other people could fix this issue
So it's now working just not using rewrite below is my solution for next customer
!
Note: I'm using Lets Encrypt TLS termination in my example;
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: redisui-ingress
labels:
app: redisui-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/app-root: /redis
spec:
tls:
- hosts:
- www.example.com
secretName: tls-secret-redisui
rules:
- host: www.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: redisui-svc
port:
number: 7843
Official rewrite docs;
Tried your docker image, unfortunately it is impossible to use it with subfolder path.
So switched to the https://github.com/joeferner/redis-commander, this is also a good tool.
ok
It is a shame this does not have a solution in place.
I just switched from redis-commander to this since p3x has a much better interface IMO.
As a sometimes sys-admin I can say we tend to install these kinds of tools a lot in sub-directories and it is for sure a turndown for many users out there. I, myself was kind of disappointed not being able to proxy this easily with Traefik.
With that said I have another hacky hack in place if you are willing to run it that way - it is not pretty but it works.
You can see it here.
Thank you for the nice tool you built here!
It is a shame this does not have a solution in place. I just switched from redis-commander to this since p3x has a much better interface IMO. As a sometimes sys-admin I can say we tend to install these kinds of tools a lot in sub-directories and it is for sure a turndown for many users out there. I, myself was kind of disappointed not being able to proxy this easily with Traefik. With that said I have another hacky hack in place if you are willing to run it that way - it is not pretty but it works. You can see it here. Thank you for the nice tool you built here!
thanks very much!