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

Does not work behind proxy after last couple of commit #50

Open
utestinc opened this issue Jun 10, 2015 · 7 comments
Open

Does not work behind proxy after last couple of commit #50

utestinc opened this issue Jun 10, 2015 · 7 comments

Comments

@utestinc
Copy link

Looks like inclusion of base href "/" broke it, so it can't be mounted as /fe/ on docker registry node
thanks!

@kwk
Copy link
Owner

kwk commented Jun 11, 2015

Hi @utestinc. Thank you for reporting the issue and sorry for the inconvenience.

The <base href="/"> in app/index.html can be changed to your liking if you decide to build your own container (simply run docker build --tag="your-registry/yourname/yourfrontend:mybase" . from the root directory). All paths in the frontend are relative and refer to the base. You can basically change it to anything you wish including /fe/.

If it works for you we can maybe think of a way to configure the base at container runtime (e.g. by introducing a new env variable ENV_BASE_HREF). Please, give it a try, would you?

The W3C says:

The base element specifies a document-wide base URL for the purposes of resolving relative URLs, and a document-wide default browsing context name for the purposes of following hyperlinks.

I hope this helps.

@utestinc
Copy link
Author

Hi @kwk,
I am using a workaround for now: Here is a snippet from the nginx config:
location /fe/ {
sub_filter 'base href="/"' 'base href="/fe/"';
sub_filter_once off;
proxy_set_header Accept-Encoding "";
proxy_pass http://docker-registry-frontend/;

If I get time I may look into adding runtime config as you mentioned, something like docker-registry-ui project.

@bpholt
Copy link

bpholt commented Jun 24, 2015

I tried the alternate base (<base href="/ui/">, in my case) and it seems to be working. It’s a little hard to tell for sure because of #53.

I also had to modify app-mode-services.js:8 because the request to app-mode.json had a leading /.

It isn’t clear to me how to introduce ENV_BASE_HREF or I’d send a pull request. Any suggestions?

@bpholt
Copy link

bpholt commented Jun 25, 2015

Since #53 has been fixed, everything seems to be working in my fork. @kwk, if you can suggest how to introduce ENV_BASE_HREF, I’ll try to implement it. In the meantime, if anyone wants to run the front-end on /ui/ feel free to use this branch in my fork or the image I published to the Hub.

@kwk
Copy link
Owner

kwk commented Jul 23, 2015

@bpholt Please check to see how all the other ENV_... variables work and do it accordingly.

@calh
Copy link

calh commented Aug 27, 2015

I still couldn't get a /ui/ prefix to work behind my haproxy load balancer, even using @bpholt's image. Every endpoint call would return the index file for some reason.

I ended up just virtual hosting it on a separate domain from my registry, and it seems to work fine. Then to reduce my hops, I linked it directly to my registry like this:

docker run -d --restart=always --name registry_ui \
  --link registry:registry \
  -e ENV_DOCKER_REGISTRY_HOST=registry \
  -e ENV_DOCKER_REGISTRY_PORT=5000 \
  -p 8080:80 \
  konradkleine/docker-registry-frontend

But, I'd still like to find a more elegant solution than a separate subdomain if possible.

@Morriz
Copy link

Morriz commented Mar 24, 2016

I strongly favor your ENV_BASE_HREF solution, if that would fix our woes. Vhosting the app is silly, as it it should never be needed, only wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants