docker nginx-proxy 添加自定义https网站

nginx-proxy配置

  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx-proxy/certs:/etc/nginx/certs:ro
      - ./nginx-proxy/config/nginx/conf.d:/etc/nginx/conf.d
      - ./nginx-proxy/acme:/acmecerts
      - ./nginx-proxy/vhost.d:/etc/nginx/vhost.d
      - ./nginx-proxy/html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: always
    networks:
      - custom_app_net
      - default

在/nginx-proxy/certs目录加以域名命名的证书文件,例如:zs.swl.ink.crt,zs.swl.ink.key

 这样就可以访问https网站:https://zs.swl.ink

posted @ 2024-04-26 13:34  shiningrise  阅读(37)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css