我试图用两个需要完全主机名的后端来运行清漆。但是我的 nginx 正在接收一个localhost主机头。
这是我的配置:
probe healthcheck {
.url = "/";
.interval = 5s;
.timeout = 15s;
.window = 5;
.threshold = 3;
}
# Define the list of backends (web servers).
# Port 443 Backend Servers for SSL
backend bimer1 {
.host = "nginx-proxy";
.host_header = "site1.example.com.br";
.port = "80";
.probe = healthcheck;
}
backend bimer2 {
.host = "nginx-proxy";
.host_header = "site2.example.com.br";
.port = "80";
.probe = healthcheck;
}
这是我的 nginx 访问日志:
bimer-cache-nginx-ssl-proxy_1 | 172.17.0.3 - - [21/Jun/2017:13:41:47 +0000] "POST /ws/Servicos/Geral/Localizacoes.svc/REST/LocalizarPessoas HTTP/1.1" 502 575 "-" "Mozilla/5.0 ( X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36" <-> localhost 172.17.0.1, 172.17.0.3
看起来将 host_header 参数设置为后端不适用于常规请求。但是健康检查运行良好。