附,squid配置反向代理配置文件示例:
## Recommended minimum configuration:# # Example rule allowing access from your local networks.# Adapt to list your (internal) IP networks from where browsing# should be allowedacl all src allacl localnet src 10.0.0.0/8 # RFC1918 possible internal networkacl localnet src 172.16.0.0/12 # RFC1918 possible internal networkacl localnet src 192.168.0.0/16 # RFC1918 possible internal networkacl localnet src fc00::/7 # RFC 4193 local private network rangeacl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines #设置拦截IPacl unallow src 46.0.0.0/8 acl SSL_ports port 443acl Safe_ports port 80 # httpacl Safe_ports port 21 # ftpacl Safe_ports port 443 # httpsacl Safe_ports port 70 # gopheracl Safe_ports port 210 # waisacl Safe_ports port 1025-65535 # unregistered portsacl Safe_ports port 280 # http-mgmtacl Safe_ports port 488 # gss-httpacl Safe_ports port 591 # filemakeracl Safe_ports port 777 # multiling httpacl CONNECT method CONNECT #设置单用户最大连接数,防止恶意攻击acl OverConnLimit maxconn 20http_access deny OverConnLimit #设置管理员信息cache_mgr Tianhuvisible_hostname Tianhu_Defender_Xhttpd_suppress_version_string on ## Recommended minimum Access Permission configuration:# # Only allow cachemgr access from localhosthttp_access allow localhost managerhttp_access deny manager # Deny requests to certain unsafe portshttp_access deny !Safe_ports # Deny CONNECT to other than secure SSL portshttp_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# #关闭web日志格式仿真emulate_httpd_log off#设置日志格式logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Ss/%Hs %