Centos 6.4下用Squid配置反向代理多个内网WEB服务器

http_port 80 accel vport
visible_hostname bogon
cache_mem 128 MB

maximum_object_size_in_memory 2048 KB

memory_replacement_policy lru

cache_dir ufs  /usr/local/squid/var/cache/squid 512 16 256

access_log /usr/local/squid/var/logs/access.log

cache_log /usr/local/squid/var/logs/cache.log

max_open_disk_fds 0

minimum_object_size 0 KB

maximum_object_size 32768 KB

#logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h""%{User-Agent}>h" %Ss:%Sh

cache_peer 192.168.20.17 parent 80  0 no-query no-digest originserver name=oa
cache_peer 10.19.113.3 parent 80  0 no-query no-digest originserver name=ob

#需要反向代理的源WEB服务器,可以添加多个 ,若只有一个源WEB服务器,可不设name

 

#需要反向代理的源WEB服务器,可以添加多个

cache_peer_domain oa oa.XXX.com.cn
cache_peer_domain ob ob.XXX.com.cn

#若只有一个源WEB服务器,可不设cache_peer_domain


http_access allow all

cache_effective_user nobody

cache_effective_group nobody

cache_mgr zifu.199s0@163.com

#refresh_pattern ^ftp: 60 20% 10080

#refresh_pattern ^gopher: 60 0% 1440

#refresh_pattern ^gopher: 60 0% 1440

#refresh_pattern . 0 20% 1440

refresh_pattern -i \.css$      360    50%    2880

refresh_pattern -i \.js$        1440    50%    2880

refresh_pattern -i \.html$      720    50%    1440

refresh_pattern -i \.jpg$      1440    90%    2880

refresh_pattern -i \.gif$      1440    90%    2880

refresh_pattern -i \.swf$      1440    90%    2880

refresh_pattern -i \.jpg$      1440    50%    2880

refresh_pattern -i \.png$      1440    50%    2880

refresh_pattern -i \.bmp$      1440    50%    2880

refresh_pattern -i \.doc$      1440    50%    2880

refresh_pattern -i \.ppt$      1440    50%    2880

refresh_pattern -i \.xls$      1440    50%    2880

refresh_pattern -i \.pdf$      1440    50%    2880

refresh_pattern -i \.rar$      1440    50%    2880

refresh_pattern -i \.zip$      1440    50%    2880

refresh_pattern -i \.txt$      1440    50%    2880

 

Linux下配置反向代理,实现一个公网IP代理多个内网的web服务器。

 

 

posted @ 2013-04-27 14:08  A light heart lives long  阅读(1681)  评论(0编辑  收藏  举报