Squid 2.7 Configuration method for multiple servers by domain name reverse proxy

Source: Internet
Author: User
Tags server memory

Detailed configuration and comments as follows, for everyone to learn the reference.

Visible_hostname squid1.abc.com
#设定squid的主机名, without this squid will not start

Http_port Accel Vhost Vport
#设定squid为accel加速模式, Vhost must be added. Otherwise, the host header cannot be forwarded to the back-end server and an error cannot be found when accessing the host header

Cache_peer 192.168.1.88 Parent 0 no-query Originserver Name=contentchina
Cache_peer 192.168.1.88 Parent 0 no-query Originserver Name=bbs
Cache_peer 192.168.1.1 Parent 0 no-query Originserver Name=ihompy
#定义不同的父节点, set the node to No-query and Originserver to indicate that the nodes are actual servers

Cache_peer_domain Contentchina aaa.abc.com
Cache_peer_domain BBS bbb.abc.com
Cache_peer_domain Ihompy ccc.abc.com
#设定不同域名转发到不同的cache_peer上, if this is not the case. Domain names may be distributed to the same server.

ACL all src 0.0.0.0/0.0.0.0
No_cache Deny All
Http_access Allow all
#允许所有客户端访问

Cache_log/var/log/squid/cache.log
#记录日志

#***********acl Access Control *************
#acl QueryString url_regex. php?

#*********** Buffered access Control *************
#no_cache Deny QueryString

#不对符合QueryString的ACL内容进行缓冲
#*********** Performance Optimization Configuration *************
Maximum_object_size 320010 KB

#大于此容量的对象将不会被保存在磁盘上, the default size is 4M, if the squid server is used to buffer large files such as Flash, it is recommended to make this value larger. Otherwise too large files will need to be retrieved again after the next reboot
maximum_object_size_in_memory MB

#最大位于内存中的对象的大小, the default size is 8K, if the server memory is large. This value can be increased appropriately, and is recommended based on the size of the site's 80% images. or customized based on the file size most frequently accessed in the Web server's actual access file

#*********** Optional Configuration *************
#dns_nameservers 10.0.0.1 192.172.0.4
#配置DNS服务器地址. Gets the IP address from this DNS when the backend is acquired
#cache_mgr [email protected]
#在错误日志中出现的webmaster地址.

Squid 2.7 Configuration method for multiple servers by domain name reverse proxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.