I trying to run varnish with two backends that needs exactly hostnames. But my nginx is receiving a localhost host header.
This is my configuration:
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;
}
This is my nginx access log:
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
It's look like set host_header parameter to backend is not working to regular request. But the healthcheck is working well.