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代理服务器配置详解的更多相关文章

  1. CAS (5) —— Nginx代理模式下浏览器访问CAS服务器配置详解

    CAS (5) -- Nginx代理模式下浏览器访问CAS服务器配置详解 tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0_65 nginx版本: nginx-1.9.8 ...

  2. 使用Squid做代理服务器,Squid单网卡透明代理配置详解(转)

    使用Squid做代理服务器 说到代理服务器,我们最先想到的可能是一些专门的代理服务器网站,某些情况下,通过它们能加快访问互联网的速度.其实,在需要访问外部的局域网中,我们自己就能设置代理,把访问次数较 ...

  3. 【转】VPN服务器配置详解

    参考博文: VPN服务器配置详解   等公司上服务器开始配置 vpn

  4. Java 反射 设计模式 动态代理机制详解 [ 转载 ]

    Java 反射 设计模式 动态代理机制详解 [ 转载 ] @author 亦山 原文链接:http://blog.csdn.net/luanlouis/article/details/24589193 ...

  5. Docker Kubernetes Service 网络服务代理模式详解

    Docker Kubernetes  Service 网络服务代理模式详解 Service service是实现kubernetes网络通信的一个服务 主要功能:负载均衡.网络规则分布到具体pod 注 ...

  6. 【转】java的动态代理机制详解

    java的动态代理机制详解   在学习Spring的时候,我们知道Spring主要有两大思想,一个是IoC,另一个就是AOP,对于IoC,依赖注入就不用多说了,而对于Spring的核心AOP来说,我们 ...

  7. java的动态代理机制详解-----https://www.cnblogs.com/xiaoluo501395377/p/3383130.html

    java的动态代理机制详解-----https://www.cnblogs.com/xiaoluo501395377/p/3383130.html

  8. 引用 Windows Server 2003 FTP服务器配置详解

    引用 昆神之星 的 Windows Server 2003 FTP服务器配置详解 1.FTP文件传输协议,主要用于计算机之间文件传输,是互联网上仅次于www的第二大服务.本文主要演示如何在Window ...

  9. 代理模式详解:静态代理+JDK/CGLIB 动态代理实战

    1. 代理模式 代理模式是一种比较好的理解的设计模式.简单来说就是 我们使用代理对象来代替对真实对象(real object)的访问,这样就可以在不修改原目标对象的前提下,提供额外的功能操作,扩展目标 ...

随机推荐

  1. 无法将 匿名方法 转换为类型“System.Delegate”,因为它不是委托类型:解决方法

    http://blog.csdn.net/xiaochongchong1248/archive/2009/11/20/4841193.aspx?1271573283 编程环境要求:VS2008/FX2 ...

  2. 屠龙之路_狭路相逢勇者胜_EighthDay

    屠龙天团的少年们追着Alpha恶龙沿路留下的粪便,一路狂奔追到了福州大学生活区三十号楼4层活动室,空气中弥漫着恶龙的臭味!屠龙少年对恶龙的隐身遁迹之术心知肚明,于是点头示意,四下散开.各自拿出了电脑, ...

  3. Mysql存储引擎之TokuDB以及它的数据结构Fractal tree(分形树)

    在目前的Mysql数据库中,使用最广泛的是innodb存储引擎.innodb确实是个很不错的存储引擎,就连高性能Mysql里都说了,如果不是有什么很特别的要求,innodb就是最好的选择.当然,这偏文 ...

  4. iOS开发小技巧-修改SliderBar指针的样式(牢记这个方法,只能通过代码来修改)

    代码: // 修改进度条的指针图片 [self.progressSlider setThumbImage:[UIImage imageNamed:@"player_slider_playba ...

  5. Mustache 使用总结

    前言: 在分析 jeesite 项目的时候,看到了 Mustache,于是查了下 正文: 1.Mustache 概述 Mustache 是基于 JavaScript 实现的模板引擎,即用来 渲染前台页 ...

  6. 安全框架 SpringSecurity 和 Shiro 对比

    突然再次很想理一下权限的事,但是实在不知道实际情况选哪个框架好,现在整理下网上的资料,做一下对比. 1.Spring-security 对spring 结合较好,如果项目用的springmvc ,使用 ...

  7. Android系统Surface机制的SurfaceFlinger服务渲染应用程序UI的过程分析

    参考:Android系统Surface机制的SurfaceFlinger服务渲染应用程序UI的过程分析 一句话概括一下Android应用程序显示的过程:Android应用程序调用SurfaceFlin ...

  8. 数据库开发基础-SQl Server 主键、外键、子查询(嵌套查询)

    主键 数据库主键是指表中一个列或列的组合,其值能唯一地标识表中的每一行.这样的一列或多列称为表的主键,通过它可强制表的实体完整性.当创建或更改表时可通过定义 PRIMARY KEY约束来创建主键.一个 ...

  9. 【PowerOJ1739】 魔术球问题

    https://www.oj.swust.edu.cn/problem/show/1739 (题目链接) 题意 n个柱子上放小球,每根柱子上相邻两个小球的数字之和必须是完全平方数,只有放了x号小球才可 ...

  10. Android成长日记-数据存储之SQLite[1]

    [SQLite简介] SQLite是R.Richard Hipp用C语言编写的开源嵌入式数据库引擎.它支持大多数的SQL92标准,并且可以在所有主要的操作系统上运行 ---支持高达2TB大小的数据库: ...