「Nginx」- [emerg] host not found in upstream “xxx” in xxx:xxx

  CREATED BY JENKINSBOT

问题描述

当遇到 [emerg] host not found in upstream 错误时,通过配置 resolver 可以解决。

但是今天遇到一个奇怪的问题:

[root@nginx02 ~]# /usr/local/tengine/sbin/nginx -t
nginx: [emerg] host not found in upstream "nianhui.dfwsgroup.com" in /usr/local/tengine/conf/virtual_host/nianhui.dfwsgroup.com.conf:15
nginx: configuration file /usr/local/tengine/conf/nginx.conf test failed

[root@nginx02 ~]# /usr/local/tengine/sbin/nginx -t
nginx: the configuration file /usr/local/tengine/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/tengine/conf/nginx.conf test is successful

我们并没有修改 Nginx 配置,它自己就好了(时间戳为证)

[root@nginx02 ~]# ll /usr/local/tengine/conf/virtual_host/nianhui.dfwsgroup.com.conf
-rw-r--r-- 1 root root 810 May  2  2019 /usr/local/tengine/conf/virtual_host/nianhui.dfwsgroup.com.conf

[root@nginx02 ~]# ll /usr/local/tengine/conf/nginx.conf
-rw-r--r-- 1 root root 2767 May 15 16:33 /usr/local/tengine/conf/nginx.conf

Tengine version: Tengine/2.3.0 (nginx/1.15.9)

问题原因

DNS 服务问题,导致域名无法被解析