Varnish常用配置详解

建立antireferer目录

[root@node1 www]# mkdirantireferer[root@node1 antireferer]# pwd

/var/www/html/antireferer

#上传图片

[root@node1 antireferer]# rz

[root@node1 antireferer]# ll

total 44

-rw-r–r–. 1 root root 42142May 22 2011 log.jpg

验证效果

[root@node1 antireferer]#curl -e ://10.0.10.61/index.html

node1

11

[root@node1 antireferer]#curl -e ://10.0.10.61/index.html

<html>

<head><title>404Not Found</title></head>

<bodybgcolor=”white”>

<center><h1>404 NotFound</h1></center>

<hr><center>nginx/1.4.2</center>

</body>

</html>

可以看到效果,我们以baidu.com为首部对其进行请求,可访问,,但如果是从qq.com对其进行资源访问则返回错误

但是为啥返回404还在研究

vcl配置基本原则

自定义vcl的时候,尽量不要拿空白文件直接写,而要复制默认配置文件,将默认配置文件的参数全部启用,再在其基础做修改,因为默认配置文件的规则比较严谨,在安全防范上有一定效果的,自己写的难免会有漏洞

所以应该以default.vcl为模板,启用其所有配置后,再进行修改

END,感谢各位。

本文出自 “心情依旧” 博客,转载请与作者联系!

人生的路无需苛求。只要你迈步,路就在你的脚下延伸。

Varnish常用配置详解

相关文章:

你感兴趣的文章:

标签云: