大网数据广告活动
网站运营与故障问答

Trouble replacing old SSL certificate on Nginx

· 52CE 我爱测

Disclaimer: This is my first ProWebmasters post. I thought this would be an appropriate place for this question but if it is not I'm happy to remove it. We use SSL For Free for our business site. We got the original certificate 9…

问题原文

原帖链接 · willbattel · CC BY-SA 3.0

Disclaimer: This is my first ProWebmasters post. I thought this would be an appropriate place for this question but if it is not I'm happy to remove it.


We use SSL For Free for our business site. We got the original certificate 95 days ago- and it expired 5 days ago. I am having trouble replacing the expired certificate.

The Nginx server is rebuilt once every 24 hours, pulling from the master branch on my Git Lab repository. The VM instance gets destroyed and replaced by a new one with a startup script that assembles and configures Nginx using the contents of the Git repository, including the SSL certificates.

When I updated the certificate and downloaded the root certificate and intermediate bundle and private key, I simply replaced the old certificates in the repository and rebuilt the web servers.

For some reason the website still uses the expired certificate days after replacing it.

This is very strange to me because the web server shouldn't have any trace of the old certificate, since they are rebuilt from a blank Ubuntu image and then pull the latest contents from Git.

I ran openssl x509 -in certificate.crt -text -noout on the certificates located in /var/www/ssl/ and confirmed that they are in-fact the new certificates.

This is the Nginx server config:

server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    server_name foobar.com www.foobar.com;

    ssl_certificate /var/www/ssl/chained.crt;
    ssl_certificate_key /var/www/ssl/private.key;

    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-EC$

    ssl_prefer_server_ciphers on;

    ssl_dhparam /var/www/ssl/dhparams.pem;

    root /var/www/html;

    location / {
        if ($http_x_forwarded_proto = "http") {
            return 301 https://$host$request_uri;
        }
        if ($request_uri ~ ^/(.*)\.html$) {
            return 301 /$1;
        }
        try_files $uri $uri.html $uri/ /404;
    }
}

Any ideas on what could be causing this? Thanks!

(I've already tried clearing my Chrome SSL Cache)

(SSLLabs shows that the site still uses the old certificate, but that other than the certificate being expired, nothing else is wrong with it)

已采纳解答

原帖链接 · willbattel · CC BY-SA 3.0

I did some more digging and, as expected, the issue was not with the Nginx server or the VM it is hosted on. I neglected to update the certificate used by our HTTP Load Balancer, so even though the servers were using the new certificate, the forwarder still had the old one which was causing the warnings.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。