Im trying to setup a reverse proxy so that i can have multiple web servers on my network.

I currently have 2 servers: - New Server Webserver/Squid Proxy - Old Server Webserver

i was able to make it so that all traffic on port 1234 on the new server ( was sent to 80 on the old server ( but im now having issues when trying to forward domains.

I want to forward like this:

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

Im not too bothered if i have to manually add all the subdomains instead of *.

Can anyone give me a config example to do this?

My squid.conf looks like this:

http_port 1234 defaultsite=
cache_peer parent 80 0 no-query originserver name=whitefall
cache_peer_domain whitefall www.arcath.net blog.arcath.net .arcath.net
cache_peer parent 80 0 no-query originserver name=londinium
cache_peer_domain londinium londinium.arcath.net

acl all src
acl localhost src
acl to_localhost dst
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
acl purge method PURGE

http_access allow all
http_access allow localhost

At the moment all domains end up going to


The following contains an example of what you try to achieve: http://wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers

Please try your above configuration changing the defaultsite instruction to

http_port 1234 defaultsite=londinium.arcath.net

According to the squid documentation

        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.
  • been looking at that, just seems to error all the time
    – Arcath
    Feb 24 '10 at 12:58
  • @Arcath, could you give some information on the errors you receive ?
    – Dominik
    Feb 24 '10 at 13:16
  • Sure, added my config file aswell
    – Arcath
    Feb 24 '10 at 13:21
  • if i remove that get "Invalid Request error was encountered while trying to process the request" when i try to go to any host
    – Arcath
    Feb 24 '10 at 13:45
  • you also need to add: vhost to the http_port line
    – Arcath
    Feb 24 '10 at 13:54

If you are trying to setup a reverse cache proxy with load balancing...please please read this before you further configure squid. If I misunderstood your needs then just ignore this post.


  • im not really doing this for the caching, its so i can run multiple web servers on one external ip
    – Arcath
    Feb 24 '10 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.