我们有一个应用程序可以将自动生成的 SSL 证书上传到我们的 NGINX 负载均衡器。有一次我们遇到了这个问题,即“错误证书”被上传,然后自动nginx reload执行,我们的服务器离线一段时间导致我们的服务器域出现 DNS 问题(未找到 DNS)。给我们的客户造成巨大的停机时间。
然而,它是我们应用程序中的一个特性/功能,允许应用程序上传 SSL 证书并且我们的后端服务器会自动安装它,有没有办法告诉我们忽略坏的 NGINXconf文件和crt/key完全?查看之前的日志,我记得在事件发生之前我看到了类似 SSL 握手错误的内容。
这是我们的主要内容nginx-jelastic.conf:
######## HTTP SECTION PROTOTYPE ########
http {
server_tokens off ;
### other settings hidden for simplicity
include /etc/nginx/conf.d/*.conf;
}
######## TCP SECTION PROTOTYPE ########
Run Code Online (Sandbox Code Playgroud)
所以我在想,如果 nginx 有可能忽略位于那里的所有坏的 NGINX conf 文件。以下是conf.d文件夹中上传内容的示例:
#
#
server {
listen 443 ssl;
server_name www.example-domain.com;
ssl_certificate /var/lib/nginx/ssl/www.example-domain.com.crt;
ssl_certificate_key /var/lib/nginx/ssl/www.example-domain.com.key;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
proxy_temp_path /var/nginx/tmp/;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
set $upstream_name common;
include conf.d/ssl.upstreams.inc;
proxy_pass http://$upstream_name;
proxy_next_upstream error;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Host $http_host;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-URI $uri;
proxy_set_header X-ARGS $args;
proxy_set_header Refer $http_refer;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Run Code Online (Sandbox Code Playgroud)
由于某种原因,配置中指示的证书和密钥可能是错误的,这会破坏 nginx 服务器,并且由于我们的域是通过 A 记录指向该服务器的,如果 nginx 因 DNS 问题发生故障而失败,那我们将是一场彻头彻尾的灾难DNS 可能需要 24-48 小时才能恢复。
| 归档时间: |
|
| 查看次数: |
6430 次 |
| 最近记录: |