Using squid as a reverse proxy on port 80, with virtual hosts and apache as a backend


I’m trying to setup a reverse proxy system with my server
I have enabled the squid module in webmin configuration, created the cache directory and started the daemon

Basically, I’d like to have
squid listening on port 80;
apache listening on port 81 and receive the cache “misses” from squid

I have already configured httpd.conf with “Listen 80” and this is my squid.conf

http_port 80 accel vhost
forwarded_for on

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

cache_peer parent 81 0 no-query no-digest originserver name=apache login=PASS

acl sites_apache dstdomain

acl our_sites dstdomain

cache_peer_access apache allow sites_apache

acl all src

acl manager proto cache_object

acl localhost src

acl to_localhost dst

acl SSL_ports port 443

acl Safe_ports port 80 # http

acl Safe_ports port 21 # ftp


http_access allow our_sites

http_access allow manager all

http_access allow manager

http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

http_access deny all

access_log /var/log/squid/access.log


(the configuration I got from a tutorial and it seems to be working well for serving the default document_root)

I can serve the document_root with squid but not the other non-default websites that I’m hosting on this server (using virtualmin’s standard virtual hosts)

Any idea about how I could do that?

Thanks in advance for your help :slight_smile: