Ok, so I would have to install squid onto loadbalance server and do something like this:
Code:
http_port 80 accel vhost
forwarded_for on
# Apache Node 1 & 2
cache_peer x.x.x.x parent 80 0 originserver name=apache1
cache_peer x.x.x.x parent 80 0 originserver name=apache2
# Put domains in a file
acl HostedSites dstdomain "/usr/local/squid/etc/allowed-sites"
http_access allow HostedSites
# Common ACL
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
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
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 1025-65535 # unregistered ports
acl CONNECT method CONNECT
# Mime types
acl php_mime req_mime_type ^application/x-httpd-php$
acl php_mime req_mime_type ^application/x-httpd-php-source$
acl php_mime req_mime_type ^application/x-httpd-php3$
acl php_mime req_mime_type ^application/x-httpd-php3-preprocessed$
acl php_mime req_mime_type ^application/x-httpd-php4$
acl ruby_mime req_mime_type ^application/x-httpd-ruby$
# File extensions
acl php_ext urlpath_regex -i \.php$
acl php_ext urlpath_regex -i \.pht$
acl php_ext urlpath_regex -i \.phtml$
acl php_ext urlpath_regex -i \.phps$
acl php_ext urlpath_regex -i \.php3$
acl php_ext urlpath_regex -i \.php3p$
acl php_ext urlpath_regex -i \.php4$
acl ruby_ext urlpath_regex -i \.rb$
acl ruby_ext urlpath_regex -i \.rhtml$
# Allow/Deny cache_peer_access mime type
cache_peer_access apache1 allow php_mime
cache_peer_access apache1 deny ruby_mime
cache_peer_access apache2 allow ruby_mime
cache_peer_access apache2 deny php_mime
# Allow/Deny cache_peer_access extensions
cache_peer_access apache1 allow php_ext
cache_peer_access apache1 deny ruby_ext
cache_peer_access apache2 allow ruby_ext
cache_peer_access apache2 deny php_ext
# Allow/Deny http_access
http_access allow manager all
http_access allow manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
# Where are the localhost and to_localhost ACL's supposed to go?
# Log traffic
access_log /var/log/squid/access.log
Is this good, or would you change anything?
EDIT: Found out I can do mime types using req_mime_type.
Thanks,
Kevin.
Recent comments
6 hours 5 min ago
10 hours 57 min ago
19 hours 49 min ago
20 hours 49 min ago
1 day 36 min ago
1 day 1 hour ago
1 day 5 hours ago
1 day 12 hours ago
1 day 21 hours ago
1 day 23 hours ago