环境:仓库使用nginx反向代理harbor,由于私服的公网ip不支持443、80等常见端口,故使用特殊端口对外网暴露
问题1:在docker push时,报错“The plain HTTP request was sent to HTTPS port”
问题2:在docker push时,报错“dial tcp x.x.x.x:443: i/o timeout”
解决方案:nginx反向代理配置中,增加如下配置:
proxy_set_header Host $http_host; # required for docker client's sake proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;