Joxit / docker-registry-ui

The simplest and most complete UI for your private registry
https://joxit.dev/docker-registry-ui/
GNU Affero General Public License v3.0
2.6k stars 323 forks source link

How to get default registries working? (getting CORS issue) #403

Open bekraupov opened 6 days ago

bekraupov commented 6 days ago

hi,

we have few internal registries we would like to expose using this registry UI.

below are the values we are setting:

iu.proxy: false
- name: DEFAULT_REGISTRIES
              value: "https://reg1.example.com,https://reg2.example.com"
registry.enabled: false 

and we dont have "registry option enabled" (so running just UI).

UI is opening up, but when we try to access it, I can see we are getting CORS error in network tab (in Chrome):

Access to XMLHttpRequest at 'https://reg1.example.com/v2/_catalog?n=1000' from origin 'https://AAA.BBB' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

What's the way out? I have tried to manually update nginx default.conf with "add-header" commands but no luck.

Joxit commented 2 days ago

Hi, this should be a configuration you have to do on you registries, see the documentation about CORS here : https://github.com/Joxit/docker-registry-ui?tab=readme-ov-file#using-cors You an also check the FAQ with the long list of linked issues

You should do the add-header in front of your registries and not the UI