【问题标题】:Varnish error : no backend connection清漆错误:没有后端连接
【发布时间】:2014-10-25 22:21:44
【问题描述】:

我尝试使用 apache2 在我的 debian 7 上安装 Varnish。

但是当我输入 www.mydomain.com:6081 来测试连接时,我得到一个 503 错误服务不可用。

清漆日志说:

 12 Hash         c www.mywebsite.com:6081
 12 VCL_return   c hash
 12 VCL_call     c pass pass
 12 FetchError   c no backend connection
 12 VCL_call     c error deliver
 12 VCL_call     c deliver deliver
 12 TxProtocol   c HTTP/1.1
 12 TxStatus     c 503

我的 etc/varnish/default.vcl 文件: (目前只有一个后端)

 backend site1 {
  .host = "92.243.5.12"; // ip adress for www.mydomain.com
  .port = "8080";
  .connect_timeout = 6000s;
  .first_byte_timeout = 6000s;
  .between_bytes_timeout = 6000s;
 }

# Default backend is set to site1
 set req.backend = site1;

我的 etc/default/varnish 文件:

   DAEMON_OPTS="-a :80
   -T localhost:6082
   -f /etc/varnish/default.vcl
   -S /etc/varnish/secret
   -p thread_pool_add_delay=2
   -p thread_pools=4
   -p thread_pool_min=200
   -p thread_pool_max=4000
   -p cli_timeout=25
   -p session_linger=100
   -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"

非常感谢

【问题讨论】:

  • 您的站点是否在 IP 92.243.5.12 的 8080 端口上运行
  • 站点运行在 80 端口,ip 92.243.5.12
  • 虽然从DAEMON_OPTS 看来,Varnish 也试图在端口 80 上启动。

标签: varnish varnish-vcl


【解决方案1】:

在您的 conf 文件中,您正在让 varnish 监听端口 80,并且您正在向端口 6081 发送请求,这可能是一个原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-02-24
    • 2016-09-21
    • 1970-01-01
    • 2017-07-03
    • 1970-01-01
    • 2014-03-23
    • 2017-11-24
    • 2014-08-21
    相关资源
    最近更新 更多