Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

docker-compose with-nginx-proxy example with self-signed ssl crashes with no debug logs

未关闭
#2,376 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, docker-compose, nginx

调研方向

从 .examples/.examples/docker-compose/with-nginx-proxy/mariadb/apache/compose.yaml 开始,使用所示的 MYSQL_PASSWORD 和 db.env 更改重现自签名证书设置。检查 reload 前后的 proxy 和生成的 nginx 配置,然后验证该示例是否能使用自签名证书成功运行,或说明如何启用更详细的 nginx 日志。

由索引模型根据 Issue 内容生成。

描述

needs info

When running the compose.yaml file from .examples/.examples/docker-compose/with-nginx-proxy/mariadb/apache with a self-signed certificate, nginx will crash with little to no explanation of what is happening. The example, running with a MYSQL_PASSWORD set and the db.env file appropriately updated, shows log entries like this, but does not explain why it is shutting down:

nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: using the "epoll" event method
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: nginx/1.27.3
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: built by gcc 13.2.1 20240309 (Alpine 13.2.1_git20240309) 
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: OS: Linux 6.1.118-Unraid
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: getrlimit(RLIMIT_NOFILE): 40960:40960
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: start worker processes
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: start worker process 24
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: start worker process 25
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: start worker process 26
<snip...>
dockergen.1 | 2025/02/08 14:22:09 Generated '/etc/nginx/conf.d/default.conf' from 4 containers
dockergen.1 | 2025/02/08 14:22:09 Running 'nginx -s reload'
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: signal 1 (SIGHUP) received from 57, reconfiguring
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: reconfiguring
dockergen.1 | 2025/02/08 14:22:10 Watching docker events
nginx.1     | 2025/02/08 14:22:09 [notice] 17#17: using the "epoll" event method

For reference, here is the dockerfile that I am using, the two changes are to set the VIRTUAL_HOST and the location of the db.env file with an appropriately updated db.env file:

services:
  db:
    image: mariadb:10.11
    command: --transaction-isolation=READ-COMMITTED
    restart: always
    volumes:
      - db:/var/lib/mysql:Z
    environment:
      - MYSQL_ROOT_PASSWORD=12345
      - MARIADB_AUTO_UPGRADE=1
      - MARIADB_DISABLE_UPGRADE_BACKUP=1
    env_file:
      - /path/to/your/db.env

  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html:z
      # NOTE: The `volumes` config of the `cron` and `app` containers must match
    environment:
      - VIRTUAL_HOST=servhostname.local
      - LETSENCRYPT_HOST=
      - LETSENCRYPT_EMAIL=
      - MYSQL_HOST=db
      - REDIS_HOST=redis
    env_file:
      - /path/to/your/db.env
    depends_on:
      - db
      - redis
      # Added proxy container dependency below. 
      # It is unclear on when or why it happens, but sometimes NC manages to start before the proxy 
      #  and it breaks for whatever weird reason resulting in the need of manual proxy container restart.
      - proxy
    networks:
      - proxy-tier
      - default

  cron:
    image: nextcloud:apache
    restart: always
    volumes:
      - nextcloud:/var/www/html:z
      # NOTE: The `volumes` config of the `cron` and `app` containers must match
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

#  letsencrypt-companion:
#    image: nginxproxy/acme-companion
#    restart: always
#    environment:
#      - DEFAULT_EMAIL=
#    volumes:
#      - certs:/etc/nginx/certs:z
#      - acme:/etc/acme.sh:z
#      - vhost.d:/etc/nginx/vhost.d:z
#      - html:/usr/share/nginx/html:z
#      - /var/run/docker.sock:/var/run/docker.sock:z,ro
#    networks:
#      - proxy-tier
#    depends_on:
#      - proxy

# self signed
  omgwtfssl:
    image: paulczar/omgwtfssl
    restart: "no"
    volumes:
      - certs:/certs
    environment:
      - SSL_SUBJECT=servhostname.local
      - [email protected]
      - SSL_KEY=/certs/servhostname.local.key
      - SSL_CSR=/certs/servhostname.local.csr
      - SSL_CERT=/certs/servhostname.local.crt
    networks:
      - proxy-tier

volumes:
  db:
  nextcloud:
  certs:
  acme:
  vhost.d:
  html:
  dhparam:

networks:
  proxy-tier:

I believe this example should be configured so that nginx-proxy produces more granular log messages, or at least put a comment in the compose.yaml that provides an environment variable that can be set to increase nginx verbosity. I'm not sure how to fix the example so that it actually runs with the self-signed certificate, though.

主要语言
Shell
星标
7.4k
派生
1.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/docker 的其他 Issue

查看 nextcloud/docker 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。