1

I am new to Varnish sorry for a noob question. In the documentation they say backend host is as vcl 4.0;

backend default {
  .host = "127.0.0.1";
  .port = "8080";
} 

I search over google all are giving example as using host as localhost or 127.0.0.1. I am confused here should it be localhost? Or It should be my hostname? or my Domain IP address? I am not using it on local server. I installed it on my hosting server. Centos 7 OS. The problem is it is working fine with using backend host as 127.0.0.1 but I don't know how. because I think it should be my domain name? can anyone explain?

user3719134
  • 43
  • 10
  • 2
    Well, if your backend is not on the same machine as the one running varnish, then your .host should be the ip of that specific machine. – Marius M May 23 '19 at 20:41

1 Answers1

0

Proper examples out of production envs often help a lot. Here is one of ours:

backend lb_prod_1 {
  .host = "10.10.20.248";
  .port = "45021";
  .probe = {
    .request = "GET /health HTTP/1.0"
                "Host: www.whatevercorp.net"
    .interval = 5s;
    .timeout = 2s;
    .window = 5;
    .threshold = 3;
  }
}

So this backend uses a service on system 10.10.20.248, port 45021, and has some non-default healthcheck parameters configured.

Tarwin
  • 592
  • 5
  • 11