squid代理服务器配置详解
root@proxy squid]# cat squid.conf
#
# Recommended minimum configuration:
#
visible_hostname www.jd.com #设置代理服务器名称
cache_mgr 888888@163.com #设置缓存管理员邮箱
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl vlan1 src 192.168.1.0/24 #定义一个网段
acl baidu dstdomain .baidu.com #定义一个域名,www可以不写 。一定要写
acl test url_regex ^http://www.rhce.cc/test/.*\.txt # 定义一个网站的txt文件
acl txt urlpath_regex \.txt& #定义所有网站的txt文件
acl zhangsan src 192.168.1.4/32 #定义一个ip
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
acl Mail_ports port 110 # pop3 定义POP3端口号
acl Mail_ports port 25 # smtp 定义SMTP端口号
acl Mail_ports port 143 # imap 定义IMAP端口号
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to certain unsafe ports
http_access allow Mail_ports #允许邮件客户端使用代理收发pop3邮件或者IMAP邮件协议
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow vlan1 #允许vlan1上网 备注:此处分优先级
cache deny txt #所有的网站的txt文件不做缓存
http_access deny baidu
http_access deny zhangsan #禁止zhangsan使用代理服务器
http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 8889 #设置代理服务器端口为8889
# Uncomment and adjust the following to add a disk cache directory.
cache_swap_low 90 #设置硬盘的缓存最低为90%
cache_swap_high 95 #设置硬盘的缓存所占硬盘空间的95%,超过95%,删除5%老数据,回到硬盘空间90%
cache_mem 10 MB #设置内存中的缓存
cache_dir ufs /var/spool/squid 100 16 256
#缓存存放位置100代表100M,16代表16个目录,每个目录里面还有256子目录,请尽量启用此功能
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
#设置缓存时间,最小为1440分钟,最大为10080分钟,超过10080认为老数据
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
squid代理服务器配置详解的更多相关文章
- CAS (5) —— Nginx代理模式下浏览器访问CAS服务器配置详解
CAS (5) -- Nginx代理模式下浏览器访问CAS服务器配置详解 tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0_65 nginx版本: nginx-1.9.8 ...
- 使用Squid做代理服务器,Squid单网卡透明代理配置详解(转)
使用Squid做代理服务器 说到代理服务器,我们最先想到的可能是一些专门的代理服务器网站,某些情况下,通过它们能加快访问互联网的速度.其实,在需要访问外部的局域网中,我们自己就能设置代理,把访问次数较 ...
- 【转】VPN服务器配置详解
参考博文: VPN服务器配置详解 等公司上服务器开始配置 vpn
- Java 反射 设计模式 动态代理机制详解 [ 转载 ]
Java 反射 设计模式 动态代理机制详解 [ 转载 ] @author 亦山 原文链接:http://blog.csdn.net/luanlouis/article/details/24589193 ...
- Docker Kubernetes Service 网络服务代理模式详解
Docker Kubernetes Service 网络服务代理模式详解 Service service是实现kubernetes网络通信的一个服务 主要功能:负载均衡.网络规则分布到具体pod 注 ...
- 【转】java的动态代理机制详解
java的动态代理机制详解 在学习Spring的时候,我们知道Spring主要有两大思想,一个是IoC,另一个就是AOP,对于IoC,依赖注入就不用多说了,而对于Spring的核心AOP来说,我们 ...
- java的动态代理机制详解-----https://www.cnblogs.com/xiaoluo501395377/p/3383130.html
java的动态代理机制详解-----https://www.cnblogs.com/xiaoluo501395377/p/3383130.html
- 引用 Windows Server 2003 FTP服务器配置详解
引用 昆神之星 的 Windows Server 2003 FTP服务器配置详解 1.FTP文件传输协议,主要用于计算机之间文件传输,是互联网上仅次于www的第二大服务.本文主要演示如何在Window ...
- 代理模式详解:静态代理+JDK/CGLIB 动态代理实战
1. 代理模式 代理模式是一种比较好的理解的设计模式.简单来说就是 我们使用代理对象来代替对真实对象(real object)的访问,这样就可以在不修改原目标对象的前提下,提供额外的功能操作,扩展目标 ...
随机推荐
- 78 mount 挂载Linux系统外的文件。
语法 mount [-hV] mount -a [-fFnrsvw] [-t vfstype] mount [-fnrsvw] [-o options [,...]] device | dir mou ...
- Eclipse运行内存溢出
VM arguments中添加如下: -Xms512m-Xmx1024m-XX:PermSize=256m-XX:MaxPermSize=256m-Xmn128m
- [转]response.getWriter().write()与out.print()的区别
原文地址:http://blog.csdn.net/javaloveiphone/article/details/8133772 1.首先介绍write()和print()方法的区别: (1).w ...
- iOS不得姐项目--封装状态栏指示器(UIWindow实现)
一.头文件 #import <UIKit/UIKit.h> @interface ChaosStatusBarHUD : NSObject /** 显示成功信息 */ + (void)sh ...
- MyBatis_Generator的使用(实践)
使用MyBatis的Generator主要配置三个地方 1.pom.xml 2.generatorConfig.xml 3.maven命令生成文件 一.pom.xml 1.引入依赖 <mysql ...
- chrome 26.0.XXX版本下media query流媒体查询有问题的bug
这段代码什么意思: @media only screen and (max-width: 1360px) 当用户的界面小于等于1360px的时候, 会加载该流媒体样式(此时的界面是包含滚动条的): ...
- sql 定义自增id插入数据
-- 定义一个自增变量 ; -- 执行自增语句 ,sponsorbroker,,, from stock_listing_detailed_info group by sponsorbroker;
- C# 时间比较大小
1.时间比较大小 DateTime t1 = new DateTime(100); DateTime t2 = new DateTime(20); ...
- MySQL 配置优化
1. 连接请求的变量: A.max_connections 如果服务器的并发连接请求量比较大,建议调高此值,以增加并行连接数量, 当然这建立在机器能支撑的情况下,因为如果连接数越多,介于MySQL ...
- bzoj4400: tjoi2012 桥
先传代码再填坑 #include <iostream> #include <cstdio> #include <cmath> #include <cstrin ...