docker-registry-ui
docker-registry-ui copied to clipboard
Add option for a path prefix (context path)
It would be great to be able to add a path prefix to run your registry-ui on a non-root path, like http://domain/registry
I currently run it behind a traefik reverse proxy which strips the /registry from the path, and it works if i use http://domain/registry/ (with trailing slash) but fails with http://domain/registry (without trailing slash) as the browser will try to locate the .css and .js from the root path instead on the /registry/ path.
Having an option to set a path prefix would make it much easier to run it behind a proxy.
Hi,
A quick fix for your issue is to force the use of the trailing slash (with a 301 redirect for example). I also use the project behind a reverse proxy (nginx) and when I go to https://example.com/ui, there is a redirect to https://example.com/ui/, Nginx did it alone.
I also want the feature of being able to set the path. Haven't checked yet if I can do it via kubernetes' nginx ingress controller, but having support directly from this software would be better. Via an environment variable if possible (kubernetes' way...)
For nginx, the correct configuration is :
location /registry/ {
proxy_pass http://docker-registry-ui/;
}
I used relative path to bypass these kinds of issues.
This is what helped me in my case
location /foo/ {
rewrite /foo/(.*) /$1 break;
proxy_pass http://registry-ui;
proxy_redirect off;
proxy_set_header Host $host;
}
Thanks @M0n7y5 , this is a common proxy configuration, I will close this issue