【发布时间】:2022-01-12 23:08:48
【问题描述】:
在 ubuntu 20.04 服务器上安装清漆和挂接后,出现以下错误:
curl: (52) 来自服务器的空回复
我正在学习的教程:
[https://docs.varnish-software.com/tutorials/hitch-letsencrypt/][1]
就我而言,我有两台服务器 s1 和 s2 都安装了 ubuntu 20.04 服务器。 s1的本地静态ip:
192.168.1.105
s2的本地静态ip:
192.168.1.106
在 s1 上安装了 virtualmin 面板,并且一切正常。所以我 决定制作一个单独的缓存服务器并安装清漆和挂钩:
sudo apt install varnish -y
sudo apt install hitch -y
default.vcl 文件的变化:
backend default {
.host = "192.168.1.105";
.port = "80";
}
hitch.conf:
# Run 'man hitch.conf' for a description of all options.
frontend = {
host = "*"
port = "443"
}
backend = "[127.0.0.1]:8443" # 6086 is the default Varnish PROXY port.
#workers = 4 # number of CPU cores
#daemon = on
# We strongly recommend you create a separate non-privileged hitch
# user and group
#user = "hitch"
#group = "hitch"
# Enable to let clients negotiate HTTP/2 with ALPN. (default off)
# alpn-protos = "h2, http/1.1"
# run Varnish as backend over PROXY; varnishd -a :80 -a localhost:6086,PROXY ..
#write-proxy-v2 = on # Write PROXY header
#pem files
pem-file = "/etc/letsencrypt/live/example.com/hitch-bundle.pem"
unit file:
[Unit]
Description=Varnish HTTP accelerator
Documentation=https://www.varnish-cache.org/docs/6.1/ man:varnishd
[Service]
Type=simple
LimitNOFILE=131072
LimitMEMLOCK=infinity
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -a localhost:8443,proxy -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,3G
ExecReload=/usr/share/varnish/varnishreload
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
注意:我对网络一无所知,所以主路由器连接第二路由器,s1和s2都直接连接第二路由器。 dmz 主机 ip 也从 s1 ip 更改为 s2 ip。
结果:
curl -i https://example.com
curl: (52) Empty reply from server.
根据这个命令 varnishlog -g request -q "ReqUrl eq '/'" VSM:无法获取 varnishd,它正在运行吗?
请指导谢谢。
【问题讨论】:
标签: ubuntu networking server varnish virtualmin