【发布时间】:2013-12-16 23:02:53
【问题描述】:
我很久以前就设置了 varnish,我的一个后端设置为 host.herokuapp.com,效果很好。有一段时间,我可以使用基本的service varnish reload 命令更改设置并重新加载清漆配置。
现在当我尝试重新加载它时,我得到:
* Reloading HTTP accelerator varnishd Command failed with error code 106
Message from VCC-compiler:
Backend host "myapp.herokuapp.com": resolves to multiple IPv4 addresses.
Only one address is allowed.
Please specify which exact address you want to use, we found these:
154.129.225.36
13.21.108.188
50.10.185.176
50.13.98.193
54.125.177.29
54.213.81.135
107.25.192.112
174.139.35.141
('/etc/varnish/backends.vcl' Line 39 Pos 27)
backend mobile { .host = "myapp.herokuapp.com"; .port = "80"; }
--------------------------#####################-----------------
In backend specification starting at:
('/etc/varnish/backends.vcl' Line 39 Pos 1)
backend mobile { .host = "myapp.herokuapp.com"; .port = "80"; }
#######---------------------------------------------------------------
Running VCC-compiler failed, exit 1
VCL compilation failed
Error: vcl.load 7ba71b44-c6b9-40e9-b0be-18f02bb5e9be /etc/varnish/default.vcl failed
由于 heroku 为其 dynos 使用动态 IP,IP 列表不断变化,因此将 IP 设置为后端是没有意义的。有什么办法可以解决这个问题吗?
【问题讨论】:
-
我也有同样的问题。有关此主题的一些背景信息:discussion.heroku.com/t/proxying-heroku-app-with-varnish/123 和 blog.cloudreach.co.uk/2013/01/…
-
您是否在同一个 Heroku 应用上托管 varnish?
标签: caching heroku cloud cdn varnish