【问题标题】:Using an IP address (and port)使用 IP 地址(和端口)
【发布时间】:2021-12-11 19:16:08
【问题描述】:

Ubuntu 18/清漆 4.x

我不确定我错过了什么。

文档 (http://manpages.ubuntu.com/manpages/xenial/en/man7/varnish-cli.7.html) 似乎建议:

...
backend.list [-p] [<backend_expression>]
  List backends.
...
Backend Expression
  A  backend  expression  can be a backend name or a combination of backend name, IP address
  and port in "name(IP address:port)" format.
...

但是,我不知道我是否遗漏了什么,因为我似乎无法在 Ubuntu 18 中传递 IP 地址或端口来列出或设置为 auto/sick:

varnish> backend.list *www*
200
Backend name                   Admin      Probe                Last updated
xxx-www-5          probe      Healthy             5/5 Fri, 22 Oct 2021 08:36:34 GMT
xxx-www-5http      probe      Healthy (no probe)   Sat, 16 Oct 2021 18:52:41 GMT
varnish> backend.list *10.105*
200
Backend name                   Admin      Probe                Last updated
varnish>

其他相关信息:

Varnish config:
...
backend xxx-www-5 {
        .host = "xxxweb05";
        .port = "xxx443";
...
}
backend xxx-www-5http {
        .host = "xxxweb05";
        .port = "xxx80";
...
}
...

$ nslookup xxxweb05
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   xxxweb05.xxx.com
Address: 10.105.xxx.xxx

【问题讨论】:

    标签: varnish-vcl varnish-4


    【解决方案1】:

    我尝试在安装 Varnish 4.1 的 Ubuntu Trusty Docker 容器上过滤 IP 地址和端口。

    它不起作用,我只设法过滤后端名称。

    但是,Varnish 4 已经死了。它已停产,不再提供任何支持和错误修复,并且存在一些已知的安全问题。

    请使用 Varnish 6:6.0 LTS 版本或任何新功能版本。

    话虽如此,此功能的最新文档不再列出 IP 地址或端口。见http://varnish-cache.org/docs/6.0/reference/varnish-cli.html#backend-pattern

    我猜这个功能在最近的版本中不再支持,而且似乎在 Varnish 4 上也不能很好地工作。

    我的建议:按照https://www.varnish-software.com/developers/tutorials/installing-varnish-ubuntu/ 中的说明安装 Varnish 6.0 LTS,忘记曾经存在过的backend.list 的 IP/端口过滤器。

    【讨论】:

      猜你喜欢
      • 2014-03-14
      • 2010-10-30
      • 1970-01-01
      • 2014-12-29
      • 1970-01-01
      • 1970-01-01
      • 2017-10-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多