Docker私有仓库搭建笔记(四)
本节主要是把nginx 反向代理设置为https ,但后端还是http的。见图:
nginx的配置文件,在笔记三中添加一节如下:
# HTTPSserver {listen 443 ssl;listen [::]:443 ssl;#访问的域名server_name hubproxy.xxx.com;#ssl 证书配置ssl_certificate "/opt/nginx/cert/xxx.com.pem";ssl_certificate_key "/opt/nginx/cert/xxx.com.key";ssl_session_cache shared:SSL:1m;ssl_session_timeout 10m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;client_max_body_size 2000m;location / {proxy_pass http://hub.xxx.com:5000;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_buffering off;proxy_request_buffering off;}location /v1/ {return 404;}location /v2/ {proxy_pass http://hub.xxx.com:5000/v2/;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;# When setting up Harbor behind other proxy, such as an Nginx instance, remove the below line if the proxy already has similar settings.# proxy_set_header X-Forwarded-Proto $scheme;proxy_buffering off;proxy_request_buffering off;}location /service/ {proxy_pass http://hub.xxx.com:5000/service/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;# When setting up Harbor behind other proxy, such as an Nginx instance, remove the below line if the proxy already has similar settings.# proxy_set_header X-Forwarded-Proto $scheme;proxy_buffering off;proxy_request_buffering off;}}
重启nginx后使和https://hubproxy.xxx.com访问。
访问如下:
测试PUSH。
docker commit -m "test2" fshjdk hubproxy.xxx.com:443/httpspush/jdk443:1.0
1.修改/etc/docker/daemon.json
{"registry-mirrors": ["https://v5e3e45v.mirror.aliyuncs.com"],"insecure-registries": ["4x.xx.xx.4x:5000","hub.xx.com:5000","hubproxy.xx.com:31923","hubproxy.xx.com"]
}
2.修改后重启docker
systemctl restart docker
3.重新启动harbor
docker-compose down -v
docker-compose up -d
4.进行push
可一直一直报错。。。。
error parsing HTTP 400 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>\r\n<body>\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>The plain HTTP request was sent to HTTPS port</center>\r\n<hr><center>nginx/1.17.2</center>\r\n</body>\r\n</html>
Get https://hubproxy.xxx.com:443/v2/: http: server gave HTTP response to HTTPS client
从错误中,可以知道V2这个被强制转为https处理,但因私有的harbor并没有开启https访问。所以。。。。。好吧,这种方式先放一下吧,暂时找不到解决方案。记下先。下一笔记直接上harbor的https先。
Docker私有仓库搭建笔记(四)相关推荐
- Centos7 Docker私有仓库搭建
Centos7 Docker私有仓库搭建 仓库:集中存放镜像的地方,可分为公共仓库和私有仓库 (公共仓库"http://hub.docker.com"或国内的"http: ...
- Docker私有仓库搭建
文章目录 Docker私有仓库搭建 1.Docker Registry 2.Docker Private Registry 2.1 使用docker-distribution自建Registry 2. ...
- Docker学习笔记 — Docker私有仓库搭建
2019独角兽企业重金招聘Python工程师标准>>> 和Mavan的管理一样,Dockers不仅提供了一个中央仓库,同时也允许我们使用registry搭建本地私有仓库. 使用私有仓 ...
- Docker私有仓库搭建与配置
docker pull registry docker run ‐di ‐‐name=registry ‐p 5000:5000 registry 此步用于让 docker信任私有仓库地址 打开浏览器 ...
- Docker 私有仓库搭建
2019独角兽企业重金招聘Python工程师标准>>> 文章首发于公众号<程序员果果> 地址:https://mp.weixin.qq.com/s/tBh6kT4I5Xn ...
- docker私有仓库搭建(registry)
文章目录 一.pull registry镜像 二.启动registry容器 三.配置参数(两种方式二选一) 方式一 方式二 四.重启docker服务 五.尝试推送镜像 六.Docker Registr ...
- Docker 私有仓库搭建,私有库镜像的推送 、拉取和删除
一.搭建私有库 docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry -v /data/config.yml:/etc/ ...
- Centos7:Docker私有仓库搭建和使用
安装并启动docker yum -y install docker systemctl start docker systemctl enable docker 搭建私有仓库 下载registry镜像 ...
- CentOS 7 : Docker私有仓库搭建和使用
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 系统环境: CentOS 7.2 192.168.0.179:docker仓库 192.168. ...
最新文章
- 来一波我和朋友们的私房菜!
- 面试题目4:二维数组中的查找
- react-native 安卓支持 gif动态图
- FPGA实验三——计数器的实现并用SignalTap验证
- 我决定开发自己的第一款iPhone应用
- 在Eclipse中编写servlet时出现The import javax.servlet cannot be resolved 问题解决办法
- 查看深信服上网管理版本号和登陆流程
- soapui 测试soap_使用SoapUI调用不同的安全WCF SOAP服务-基本身份验证,第一部分
- shiro修改html不生效,shiro中anon配置不生效
- Python数据清洗基本流程
- 菜鸟ING的博客终于开园了。
- java二进制 中文_Java 实现中文与二进制代码互转
- 北京思源培训中心---C#下用P2P技术实现点对点聊天(2)
- .NET(C#):XmlArrayItem特性和XmlElement特性在序列化数组的差别
- python画3d图-python3利用Axes3D库画3D模型图
- 安装cuda10.1
- PRML学习总结(1)——Introduction
- 软件计算机考研考英语几,软件工程考研考哪几科
- 统计报表币种金额_海关总署就全面发布以人民币计价统计数据答问
- 微信小程序之组件传值