squid.3.3.4配置限制访问域名
2013-05-16 00:36
1701 查看
1:允许用户访问某些域名,我测试环境只写了一个;
测试环境:修改本地host文件,指定上面2个域名对应一个IP;
2:允许用户访问png格式图片配置:
效果图:
官方文档介绍:
# # h1:m1 must be less than h2:m2
#
# acl aclname url_regex [-i] ^http:// ...
# # regex matching on whole URL [fast]
# acl aclname urllogin [-i] [^a-zA-Z0-9] ...
# # regex matching on URL login field
# acl aclname urlpath_regex [-i] \.gif$ ...
# # regex matching on URL path [fast]
#
[root@BJ-fastcache132 etc]# cat acl.txt s0.hao123img.com
测试环境:修改本地host文件,指定上面2个域名对应一个IP;
acl aclname dstdomain "/app/squid/etc/acl.txt" http_access allow aclname http_access deny all
2:允许用户访问png格式图片配置:
acl allow_sites urlpath_regex -i \.png$ http_access allow allow_sites http_access deny all
效果图:
官方文档介绍:
# # h1:m1 must be less than h2:m2
#
# acl aclname url_regex [-i] ^http:// ...
# # regex matching on whole URL [fast]
# acl aclname urllogin [-i] [^a-zA-Z0-9] ...
# # regex matching on URL login field
# acl aclname urlpath_regex [-i] \.gif$ ...
# # regex matching on URL path [fast]
#
相关文章推荐
- linux+tomcat配置域名访问指定项目,不用接项目名
- Tomcat域名或IP地址访问方式配置方法
- nginx 访问频率限制配置
- Tomcat配置域名/IP访问及其中遇到的问题注意事项
- [转载]本地配置的 *.dev,*.app域名 在谷歌浏览器中总是自动转跳到https上,导致不能访问?
- 使用本地域名 访问本地项目,本地host文件配置
- Nginx配置——区分PC或手机访问不同域名
- Tomcat 配置访问限制:访问白名单和访问黑名单
- apache配置访问限制
- Pod中访问外部的域名配置
- Apache配置虚拟域名后localhost无法正常访问
- tomcat6.0 配置多个项目(网站)用域名可以直接访问
- WAMP完整配置教程(启用php extensions、修改端口、允许外网访问、wamp绑定域名)。
- Windows环境下apache 配置(多域名访问多目录站点)
- 命令行配置IIS7 IP和域名限制
- 通过Nginx配置多域名访问
- Tomcat Catalina子项目配置多域名访问
- 一个服务器下配置多个项目,输入域名就能访问项目
- 如何配置VS使得可以通过域名或IP访问
- Linux下通过iptables配置工具限制ip访问服务器