环境
Harbor通过docker-compose方式部署在内网,用Nginx代理后(此时相当于存在两个Nginx)。通过外网https登录报错“unauthorized: authentication required”
docker login -u pony https://harbor.xxx.com/ -p xxxx
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get "https://harbor.xxx.com/v2/": unauthorized: authentication required
在Harbor v2.x版本中如果需要使用Nginx代理,官方提供了external_url参数来解决这个问题,在harbor.yml文件中配置这个参数
# Uncomment external_url if you want to enable external proxy
# And when it enabled the hostname will no longer used
# external_url: https://reg.mydomain.com:8433
external_url: https://reg.mydomain.com:8433
修改完成后,重新生成配置文件启动Harbor
./prepare
./install.sh
MuChen
感谢