由于我们的服务监控是通过钉钉机器人进行报警通知,但是大多客户自建服务器都是禁止访问外网 只能通过dmz域的代理服务器,做正向代理进行访问
1.配置钉钉通知机器人接口调用地址正向代理
location /robot{
proxy_pass https://oapi.dingtalk.com/;
proxy_redirect off;
proxy_set_header Host oapi.dingtalk.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
如果在不改钉钉调用地址的方式下,需要在服务器本地做硬解析
2.修改需要监控的服务器hosts 做硬解析
10.10.22.xx 为代理服务器的IP
10.10.22.xx oapi.dingtalk.com