配置nginx代理ingress解析的地址报错:host not found in upstream
问题描述:nginx代理ingress的地址报错host not found in upstream。1.配置文件样例内容如下:location /skyfans-k8sbe/ {proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Hos...
·
问题描述:nginx代理ingress的地址报错host not found in upstream。
1.配置文件样例内容如下:
location /skyfans-k8sbe/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host "mmm66666.skyfans-k8s.com";
proxy_pass http://mmm66666.skyfans-k8s.com;
}
location /skyfans-k8sfe/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host "tttt8888.skyfans-k8s.com";
proxy_pass http://tttt8888.skyfans-k8s.com;
}
2.配置完毕后,nginx执行检查配置文件命令
nginx -t
出现报错:
host not found in upstream
3.问题原因。
我们试着ping下配置的域名
ping tttt8888.skyfans-k8s.com
4.提示解析不到。
5.处理解决方法:
在nginx的服务器上配置DNS服务器的IP。
6.配置dns到nginx服务器
echo "nameserver 192.168.111.111" > /etc/resolv.conf
7.问题解决!!!
更多推荐
已为社区贡献7条内容
所有评论(0)