Nginx [SSL:CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
当 Nginx 配置 url 访问是 https 格式时,如果报下面错误:
nginx
-----
- instance #0 [ERROR]: '[SSL:CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'
- collected 0 metrics,0 event & 2 servise check
这是因为访问 Nginx 的 url 没有信任的 SSL 证书,所以如果您不想验证 SSL 证书,在 nginx.yaml 配置文件中添加参数 ssl_validation
:
init_config:
instances:
# For every instance, you have an `nginx_status_url` and (optionally)
# a list of tags.
- nginx_status_url: https://localhost/nginx_status
tags:
- tag_key:tag_value
ssl_validation: False
注意 YAML 对齐格式。