Skip to content

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

@lesinigo

Description

@lesinigo

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/)?

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions