无法获得清漆以查看后端
Can't get varnish to see backend
我在 OSX 本地安装了 Varnish 来测试它。我在 localhost:8085 上有一个工作后端 运行ning returns 200。我用 Brew 安装了清漆,但没有 Brew 服务 运行ning,我改为 运行 清漆
varnishd -n /usr/local/var/varnish -f /usr/local/etc/varnish/default.vcl -T 127.0.0.1:8085 -a 127.0.0.1:8090 -F
打印
Debug: Platform: Darwin,17.5.0,x86_64,-jnone,-sdefault,-sdefault,-hcritbit
Debug: Child (57659) Started
Info: Child (57659) said Child starts
并在 /usr/local/var/varnish
中创建一个 vcl_boot.*
文件夹
当我去 127.0.0.1:8090
时,我看到清漆是 运行ning 但只是得到
Error 503 Backend fetch failed
Backend fetch failed
我的 /usr/local/etc/varnish/default.vcl
几乎是默认值:
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8085";
}
sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don't need,
# rewriting the request, etc.
}
sub vcl_backend_response {
# Happens after we have read the response headers from the backend.
#
# Here you clean the response headers, removing silly Set-Cookie headers
# and other mistakes your backend does.
}
sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
}
有谁知道我可能遗漏了什么?
谢谢!
在您对 运行 Varnish 的命令中,我认为您错误地使用了 -T 127.0.0.1:8085
。 -T
开关用于:
Offer a management interface on the specified address and port.
因此,您将 Varnish 管理接口绑定到与后端相同的端口。想知道为什么无论如何都不会失败。
我在 OSX 本地安装了 Varnish 来测试它。我在 localhost:8085 上有一个工作后端 运行ning returns 200。我用 Brew 安装了清漆,但没有 Brew 服务 运行ning,我改为 运行 清漆
varnishd -n /usr/local/var/varnish -f /usr/local/etc/varnish/default.vcl -T 127.0.0.1:8085 -a 127.0.0.1:8090 -F
打印
Debug: Platform: Darwin,17.5.0,x86_64,-jnone,-sdefault,-sdefault,-hcritbit
Debug: Child (57659) Started
Info: Child (57659) said Child starts
并在 /usr/local/var/varnish
vcl_boot.*
文件夹
当我去 127.0.0.1:8090
时,我看到清漆是 运行ning 但只是得到
Error 503 Backend fetch failed
Backend fetch failed
我的 /usr/local/etc/varnish/default.vcl
几乎是默认值:
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8085";
}
sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don't need,
# rewriting the request, etc.
}
sub vcl_backend_response {
# Happens after we have read the response headers from the backend.
#
# Here you clean the response headers, removing silly Set-Cookie headers
# and other mistakes your backend does.
}
sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
}
有谁知道我可能遗漏了什么?
谢谢!
在您对 运行 Varnish 的命令中,我认为您错误地使用了 -T 127.0.0.1:8085
。 -T
开关用于:
Offer a management interface on the specified address and port.
因此,您将 Varnish 管理接口绑定到与后端相同的端口。想知道为什么无论如何都不会失败。