使用letsencrypt更新证书后,SSL无法正常工作

时间:2016-08-09 17:30:15

标签: macos ssl nginx https lets-encrypt

我有nginx,我主要用作反向代理。我在家里有很多服务,比如Plex。可以通过plex.mydomain.com访问它,我已经为其创建了一个letsencrypt证书。 在我更新了letsencrypt证书之前,一切都运行良好。从那时起,只有我的桌面Chrome仍然有效,但我怀疑它是因为它的缓存而这样做。 Safari不起作用,既不卷曲也不生成。

nginx conf是以下

server {
        listen                  80 ;
        server_name  plex.mydomain.com plex.myotherdomain.com ;
        rewrite ^ https://$server_name$request_uri? permanent;
}
server {
        listen        443;
        server_name  plex.mydomain.com plex.myotherdomain.com ;
        satisfy any;
        allow 192.168.1.0/24; ##chez moi
        deny all;
        auth_basic "closed site";
        auth_basic_user_file /etc/nginx/certs/password;
        ssl_certificate /etc/letsencrypt/live/plex.mydomain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/plex.mydomain.com/privkey.pem;


        location / {
            proxy_pass        http://192.168.1.102:5000;
            proxy_redirect http:// $scheme://;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

    }
}

如果我运行curl https://plex.mydomain.com,那么我会获得curl: (56) SSLRead() return error -9806

当我从Safari访问plex.mydomain.com时,Nginx日志会给出

2016/08/09 19:23:27 [alert] 52081#0: worker process 53076 exited on signal 11
2016/08/09 19:23:27 [notice] 52081#0: start worker process 53079
2016/08/09 19:23:27 [notice] 52081#0: signal 23 (SIGIO) received
2016/08/09 19:23:27 [notice] 52081#0: signal 23 (SIGIO) received

使用以下命令生成了letsencrypt证书:

sudo certbot certonly --standalone -d plex.mydomain.com -d plex.myotherdomain.com

知道我做错了什么吗? 非常感谢你的帮助。

1 个答案:

答案 0 :(得分:0)

我通过生成新证书来修复此问题,我也提到了根域名。 然后整个命令是certbot certonly --standalone -d mydomain.com -d myotherdomain.com -d plex.mydomain.com -d plex.myotherdomain.com

而现在,它就像一个魅力。 谢谢你们的帮助。

相关问题