我已经在Ubuntu20.04服务器上安装了Nginx公司的Nginx Prometheus exporter (https://github.com/nginxinc/nginx-prometheus-exporter)。尝试启动该服务时,出现错误:
Could not create Nginx Client: failed to get https://domain.tld/nginx-status: Get "https://domain.tld/nginx-status": dial tcp 127.0.1.1:443: connect: connection refusedurl https://domain.tld/nginx-status运行正常。
这是我正在使用的配置文件:
[Unit]
Description=Nginx Prometheus Exporter
After=network.target
[Service]
Type=simple
User=nginx_exporter
Group=nginx_exporter
ExecStart=/usr/local/bin/nginx-prometheus-exporter \
-web.listen-address=server_IP:9113 \
-nginx.scrape-uri https://domain.tld/nginx-status
SyslogIdentifier=nginx_prometheus_exporter
Restart=always
[Install]
WantedBy=multi-user.target发布于 2021-11-02 10:42:26
所以问题出在/etc/hosts文件中的一个条目...
127.0.0.1 domain.tld现在exporter正在启动,没有任何错误!
感谢@anemyte
https://stackoverflow.com/questions/69801868
复制相似问题