Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lesinigo opened this issue Mar 21, 2019 · 4 comments

Comments

@lesinigo
Copy link

commented Mar 21, 2019

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

@lesinigo

This comment has been minimized.

Copy link
Author

commented Mar 21, 2019

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.

@Joxit Joxit added the bug label Mar 21, 2019

@Joxit

This comment has been minimized.

Copy link
Owner

commented Mar 21, 2019

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

@Joxit Joxit self-assigned this Mar 21, 2019

@Joxit Joxit added this to To do in docker-registry-ui via automation Mar 21, 2019

@Joxit Joxit closed this in f1bff47 Mar 21, 2019

docker-registry-ui automation moved this from To do to Done Mar 21, 2019

@Joxit

This comment has been minimized.

Copy link
Owner

commented Mar 21, 2019

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

@Joxit

This comment has been minimized.

Copy link
Owner

commented Mar 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.