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
Closed
Assignees
Labels

Comments

@lesinigo
Copy link

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
Copy link
Author

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
Copy link
Owner

Joxit 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 closed this as completed in f1bff47 Mar 21, 2019
@Joxit
Copy link
Owner

Joxit commented Mar 21, 2019

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

@Joxit
Copy link
Owner

Joxit 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
Labels
Projects
Development

No branches or pull requests

2 participants