打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
docker-compose的nginx更换完ssl证书不起作用的完美解决方法
userphoto

2023.08.03 上海

关注

以Harbor为例,ssl证书更新后,docker-compose启动不起作用。

问题出在一句很重要的命令:./prepare

步骤:(Harbor样例)

  1.   cd /data/ssl 换ssl证书 

  Harbor.yml ssl证书部分:

# Configuration file of Harbor

# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: reg.xxx.cn

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 80

# https related config
https:
  # https port for harbor, default is 443
  port: 443
  # The path of cert and key files for nginx
  certificate: /data/ssl/xxx.cn_server.crt
  private_key: /data/ssl/xxx.cn_server.key

# # Uncomment following will enable tls communication between all harbor components
# internal_tls:
#   # set enabled to true means internal tls is enabled
#   enabled: true
#   # put your cert and key files on dir
#   dir: /etc/harbor/tls/internal

# 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

# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.

然后:

docker-compose down

docker ps -a

./prepare   #这个必须得执行,否则ssl证书不生效

docker-compose up -d

docker ps

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Harbor 2.1.2 安装部署
Harbor安装 -- 企业级Registry仓库
首席领导者
docker 镜像仓库 Harbor 部署 以及 跨数据复制
docker命令及其常用事项
Docker--consule-Nginx群集负载均衡&harbor
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服