varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.68k stars 377 forks source link

Probes ignore a manually specified request's port #2703

Closed svenstaro closed 6 years ago

svenstaro commented 6 years ago

I'm using a config like this:

backend mybackend {
  .host = "192.168.99.1";
  .port = "10080";
  .probe = {
    .request =
      "GET /something HTTP/1.1"
      "Host: localhost:5555"
      "Connection: close"
      "User-Agent: Varnish Health Probe";
    .timeout = 1s;
    .interval = 5s;
    .window = 1;
    .threshold = 1;
  }
}

Expected Behavior

I would expect varnish to query localhost:5555/something

Current Behavior

It insteads queries localhost:10080/something. Effectively. it ignores the port provided in the Host part of the manually written HTTP request.

Possible Solution

In case the Host part has a port, always use that. It's definitely the intended behavior in all cases if the user proivdes their port for the probe host manually.

Your Environment

fgsch commented 6 years ago

The Host header is just that, a header; the probe port comes from the port.

nigoroll commented 6 years ago

@slimhazard once wrote https://code.uplex.de/uplex-varnish/oob_probe/ for this purpose. We might want to put this back on the table as a feature request, so I'll add it for the next bugwash and reopen temporarily

nigoroll commented 6 years ago

the disucssion has already happened and the outcome is that the vmod is the appropriate solution.