反向代理与鱿鱼

我试图设置一个反向代理,以便我可以在我的networking上有多个Web服务器。

我目前有2个服务器:

10.0.0.45 - New Server Webserver/Squid Proxy 10.0.0.40 - Old Server Webserver 

我能够使新服务器(10.0.0.45)上的端口1234上的所有stream量都在旧服务器(10.0.0.40)上发送到80。 但即时通讯现在有问题时,试图转发域名。

我想要这样转发:

 *.arcath.net -> 10.0.0.40 londinium.arcath.net -> 10.0.0.45 support.ed-itsolutions.com -> 10.0.0.40 

我不太烦,如果我不得不手动添加所有的子域而不是*。

任何人都可以给我一个configuration的例子来做到这一点?

我的squid.conf看起来像这样:

 http_port 1234 defaultsite=10.0.0.45:80 cache_peer 10.0.0.40 parent 80 0 no-query originserver name=whitefall cache_peer_domain whitefall www.arcath.net blog.arcath.net .arcath.net cache_peer 10.0.0.45 parent 80 0 no-query originserver name=londinium cache_peer_domain londinium londinium.arcath.net acl all src 0.0.0.0/0.0.0.0 acl localhost src 127.0.0.1/255.255.255.255 acl to_localhost dst 127.0.0.0/8 acl SSL_ports port 443 # https acl SSL_ports port 563 # snews acl SSL_ports port 873 # rsync 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 Safe_ports port 631 # cups acl Safe_ports port 873 # rsync acl Safe_ports port 901 # SWAT acl web dstdomain 10.0.0.40 acl purge method PURGE acl CONNECT method CONNECT http_access allow all http_access allow localhost 

目前所有域名最终都要到10.0.0.45

以下包含您尝试实现的示例: http : //wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers

请尝试你的上面的configuration改变defaultsite指令

 http_port 1234 defaultsite=londinium.arcath.net 

根据鱿鱼文件

 defaultsite=domainname What to use for the Host: header if it is not present in a request. Determines what site (not origin server) accelerators should consider the default. Implies accel. 

如果您尝试设置负载平衡的反向caching代理…请在进一步configurationsquid之前阅读此内容。 如果我误解了你的需求,那就忽略这个post吧。

http://varnish-cache.org/wiki/ArchitectNotes