nginx ssl_preread配置不将请求重定向到上游

时间:2018-09-11 18:41:28

标签: nginx load-balancing puppet nginx-reverse-proxy

我在木偶代理和两个木偶大师之间拥有nginx。说puppetmaster1和puppetmaster2

因此预期的连接流为

puppetagent1->> Nginx->> puppetmaster1&

puppetagent2->> Nginx->> puppetmaster2

puppetmaster1和puppetagent1在puppet版本2.7.26上运行

puppetmaster2和puppetagent2在puppet版本3.6.2上运行

这是我的nginx stream.conf,它将代理传递给上游

map $ssl_preread_server_name $name {
puppetmaster1  upstream_puppetmaster1;
puppetmaster2  upstream_puppetmaster2;

}

upstream upstream_puppetmaster1 {
     server core-services_puppetmaster1:8140;
    }

 upstream upstream_puppetmaster2 {
     server core-services_puppetmaster2:8140;
    }


server {
    listen                8140;
    ssl_preread           on;
    proxy_pass            $name;
  }

问题: 在 puppetagent2 上运行puppet agnet -tov时,Nginx将其重定向到 upstream_puppetmaster2 ,一切正常 但是,当在puppetagent1上运行puppet agnet -tov时,Nginx会出现以下日志错误

2018/09/11 17:38:11 [info] 25#25: *3 client 10.255.0.2:51290 connected to 0.0.0.0:8140
2018/09/11 17:38:11 [error] 25#25: *3 no host in upstream "", client: 10.255.0.2, server: 0.0.0.0:8140, bytes from/to client:0/0, bytes from/to upstream:0/0

puppetmaster1和puppetmaster2之间的唯一区别是版本

有人可以帮助我弄清楚为什么Nginx无法处理来自puppetagent1的请求并将其传递给puppetmaster1吗? 我该如何实现?

预先感谢

0 个答案:

没有答案