[squid-users] apache + squid as forward and reverse proxy on a head node?

From: Chris Davis <c_b_dvs_at_yahoo.com>
Date: Tue, 29 Mar 2011 00:58:17 -0700 (PDT)

Is it possible on a single server to have apache running along with squid set up
as both a forward and reverse proxy? I'm running into a problem where requests
sent through the forward proxy seem to be redirected to the reverse proxy and I
always get a copy of the front page of my site.

I'm setting up a small cluster where only the head node has a connection to the
internet. This head node is then connected to a group of nodes via a local
network, who can only connect to the internet via a forward proxy. Recently I
tried to set up squid also as a reverse proxy for an apache server on the head
node, but I could only get squid working either as a forward or reverse proxy,
but not both. I've tested this using the squid.conf shown below by only
commenting out the two lines at the end associated with each mode (i.e. the
http_port, etc). Based on this, it seems that (most of) my settings are sane.

When I enable both a reverse and forward proxy, the problem is that any of the
requests coming from the nodes on the local network get redirected to the apache
server. I've tested this with wget, and no matter what URL I put in, I get the
front page of my site. The reverse proxy works fine.

I'm using squid 2.7.STABLE7 along with Apache 2.2.14, and have set up apache to
listen on port 81, with squid listening on port 3128.

Any help/pointers would be greatly appreciated.

Best regards,

Chris

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

acl web_ports port 80
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 purge method PURGE
acl lanhome src 10.1.1.0/255.255.255.0
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow lanhome
http_access allow localhost
http_access allow web_ports

http_access deny all
icp_access allow localnet
icp_access deny all
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Package(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320

acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
hosts_file /etc/hosts
coredump_dir /var/spool/squid

visible_hostname mysite
http_port 10.1.1.100:3128 transparent

http_port x.x.x.x:80 accel defaultsite=mysite.com
cache_peer 127.0.0.1 parent 81 0 originserver

      
Received on Tue Mar 29 2011 - 07:58:23 MDT

This archive was generated by hypermail 2.2.0 : Tue Mar 29 2011 - 12:00:02 MDT