【问题标题】:Tell nginx to silently ignore missing files告诉 nginx 静默忽略丢失的文件
【发布时间】:2019-04-02 09:23:39
【问题描述】:

我正在寻找一种方法告诉 nginx 使用特定证书(如果可用),否则静默忽略(即不要崩溃)

server {
    listen      443 ssl;
    server_name myapp.io;

    ssl_certificate           /path/to/my/certificate.cer;
    ssl_certificate_key       /path/to/my/certificate.key;
}

目前这会崩溃

2018/10/29 12:25:16 [emerg] 18978#0: BIO_new_file("path/to/my/certificate.cer") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('path/to/my/certificate.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)

我想要实现的是让服务器运行,这样 certbot 可以为我生成证书并随后添加它,但目前服务器在找不到文件时崩溃,这对我来说很脆弱。

【问题讨论】:

    标签: ssl nginx certbot


    【解决方案1】:

    我认为不可能实现你想要的。而是为 ssl 生成和使用自签名证书,或者只为端口 80 配置 nginx,直到您获得 CA 签名证书。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-06
      • 1970-01-01
      • 2011-06-20
      • 1970-01-01
      • 2013-10-13
      • 1970-01-01
      • 2014-06-09
      • 1970-01-01
      相关资源
      最近更新 更多