-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
where to put Access-Control-Allow-Origin header? #278
Comments
Hello, thank you for using my project. Please read the documentation about CORS
That means in your nginx configuration you should use this line instead of
|
Hello, Joxit I created on ubuntu 2 site: registry.site and ui.registry.site
Cors error becuse 1 reques body has no header:
401 Auth error, header has cors :
|
Hi @sorcerb okay, so this one is in the FAQ
So your options are :
|
Hi, thanks for your reply but i still cannot really figure out how to make it work.
|
The line As I said last time you should read the CORS section from the doc. If you want to add the access control allow origin, this is a docker registry server configuration, or your personal nginx configuration, not a UI one! If you want to configure your docker registry server, add in your http:
headers:
Access-Control-Allow-Origin: ['http://registry.example.com']
Access-Control-Allow-Credentials: [true]
Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS'] # Optional |
Hi @Joxit, I have a related question regarding multiple entries in Access-Control-Allow-Origin header. I use basic auth in my registry. With this header: So, my question would be: Are the multiple entries in the Access-Control-Allow-Origin supported? Or I have to just pick one? Or I should ditch the basic auth and it will work then? |
Hi @gergaly , please refer to the
This is applied to multiple origins too, when you're using credentials/basic auth, only one origin can be set, this is a part of your browser security. As I said in other messages, if you want to get rid of CORS issues, use |
Hi @Joxit, has this bug been communicated to the distribution project? This is quite old and well-known issue that is not allowing CORS to be used fully with existing distribution images. As a sidenote: "Allow" is missing here: |
Here is the issue I just posted : distribution/distribution#4458 Thanks for the sidenote, I always forget to updte docker hub page.... It's a shame, it's impossible to update it via the CI |
Since the maintainer will not fix this issue, I will close this one and update the FAQ. |
hi there, i am running your registry ui wich is supposed to use my private registry.
so i am running this: joxit/docker-registry-ui:latest with these environment variables:
REGISTRY_TITLE=asdfasdf
SIGNLE_REGISTRY=true
REGISTRY_URL=https://dockerregistry.beta.url.com
the registry needs pw/user authentification (via htaccess) it also has in the nginx configuration:
i sadly still get the Access-Control-Allow-Origin error:
accessing this in the browser totally works:
https://dockerregistry.beta.url.com/v2/_catalog?n=100000
what am i doing wrong here? any help would be great!!
Thanks a lot!
The text was updated successfully, but these errors were encountered: