首页 > 解决方案 > 扩展参数 certbot 没有交互式问题;只是扩展它

问题描述

我正在使用 nginx 和 certbot。为了管理两者,我使用docker-compose. 这是我使用的 * .yml。

version: "3"

# Services
services:

  # certbot
  certbot:
    image: certbot/certbot:latest
    container_name: warehouse-certbot
    command: certonly --webroot --webroot-path=/var/www/certbot --email ahmadfadlydziljalal@gmail.com --agree-tos --no-eff-email -d tsurumaru.online -d backend.tsurumaru.online -d www.tsurumaru.online --expand
    volumes:
      - ./docker/nginx/certbot/conf:/etc/letsencrypt
      - ./docker/nginx/certbot/logs:/var/log/letsencrypt
      - ./docker/nginx/certbot/data:/var/www/certbot

  # Web Server Service
  nginx:
    image:  "${REGISTRY_HOST}/warehouse-nginx"
    build:
      context:  "./docker/nginx"
      dockerfile: "Dockerfile"
    container_name: warehouse-nginx
    ports:
      - "80:80" # backend dan frontend di port 80, yang bermain adalah domain dan subdomain
      - "443:443" # Untuk https
    volumes:
      - ./:/var/www/html
      - ./docker/nginx/conf.d/default.prod.conf:/etc/nginx/conf.d/default.conf:ro # OVERRIDE
      - ./docker/nginx/certbot/conf:/etc/nginx/ssl
      - ./docker/nginx/certbot/data:/var/www/certbot
    depends_on:
      - php
    networks:
      - warehouse-network

随着 docker-compose up,nginx 正在运行,但是如果我在 cerbot 容器中看到它说:

You have an existing certificate that contains a portion of the domains you
requested (ref: /etc/letsencrypt/renewal/tsurumaru.online.conf)

It contains these names: tsurumaru.online, www.tsurumaru.online

You requested these names for the new certificate: tsurumaru.online,
backend.tsurumaru.online, www.tsurumaru.online.

Do you want to expand and replace this existing certificate with the new
certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
An unexpected error occurred:
EOFError
Please see the logfiles in /var/log/letsencrypt for more details.
(E)xpand/(C)ancel:

如何传递扩展值?如您所见,我已经写了--expand,但仍然失败:

certonly --webroot --webroot-path=/var/www/certbot 
--email ahmadfadlydziljalal@gmail.com 
--agree-tos --no-eff-email 
-d tsurumaru.online 
-d backend.tsurumaru.online 
-d www.tsurumaru.online 
--expand

标签: dockernginx

解决方案


推荐阅读