Joxit / docker-registry-ui

The simplest and most complete UI for your private registry

Home Page:https://joxit.dev/docker-registry-ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

revproxy to registry does not work when published under non-root url

lesinigo opened this issue · comments

I have successfully set up everything using the joxit/docker-registry-ui:1.1-static docker image, with its port published via docker and accessed from my browser. I use the proxy-to-registry feature to avoid messing with CORS and it works.

My registry is in another docker container with its port directly published:

  • registry: http://dockerlab.home:5000/
  • registry-ui: http://dockerlab.home:5080/
  • REGISTRY_URL=http://dockerlab.home:5000 PULL_URL=http://dockerlab.home:5000

Now if I try to put a reverse proxy (Traefik, but I can reproduce with Nginx or Apache) and configure it to forward http://dockerlab.home/registry/ to the registry-ui stripping the base path (/registry/foo gets forwarded as /foo), the registry proxy feature does not work correctly.

I get all registry-ui assets loaded correctly in my browser, thanks to it using relative URLs, but then it tries to load registry data from http://dockerlab.home/v2/_catalog?n=100000 instead of http://dockerlab.home/registry/v2/_catalog?n=100000.

Seems like there is something in the code that is generating absolute URIs for the registry calls instead of relative ones as used for all other assets.

Is it possible to get relative URLs for the registry proxy links and/or an environment variable to specify the base url to generate URLs from (which in my case would be http://dockerlab.home/registry/)?

Oh and I should mention that there is no problem if you don't use REGISTRY_URL but use URL instead (and set up CORS headers accordingly).

The reported issue is limited to using the built-in proxy-to-registry feature with REGISTRY_URL.

Hi,
Thank you for your issue, I confirm this bug, I will fix this ASAP :)

Should be fixed now 😄
Thank you again for your issue.
I added an example with this use case.

I had some issues with the new docker hub automated build but I just fixed it.
You can pull either 1.1 or master tags.