I read How to setup a Squid Reverse Proxy? and the links in it but I don't seem to get it.
All I want is this:
have squid run on some port (default 3128 is fine) I will redirect all requests that go to port 80 on my NAT to port 3128 on the server running squid. (actually I think I got this part done).
now I want to modify squid.conf so that for example if the request is for host1.mydomain.com it should be redirected to port 80 on local_IP_Address_1 and if it is for host2.mydomain.com it should go to port 80 on local_IP_Address_2
Thats it. no caching for now please. no nothing - just proxy the request and thats all. I also don't need SSL for now, but if the answer would include information about SSL as well, thats cool.
some more info: I have two machines on a local net SRV1 and SRV2 with IPs IP1 and IP2. SRV1 should serve several domains (dom1.mydomain.com and dom2.mydomain.com) while SRV2 should serve several domains (dom3.myOtherDomain.com and dom4.mydomain.com).
all the above domains are set with CNAME records to point to a single common.mydomain.com. This is all running behind a router with NAT.
I thought that what I need is to have squid run on some port (default 3128 is fine) of SRV1, redirect all requests that go to port 80 on my NAT to port 3128 on the server running squid. (actually I think I got this part done).
I thought the way it should work is WEB->ROUTER:80 -> squid on SRV1:3128 -> SRV1/2 (based on host) :80.
but I am having problems.
Right now it seems that the request that is sent from squid on SRV1 to SRV2 is sent on port 80 but the request URL itself has the port 3128. i.e. a GET http://dom4.mydomain.com:3128/path is sent to port 80 on SRV2.
Any idea how to remove the :3128 from the requst sent from squid onwards ?
or do I have to move squid to port 80 and the other servers to another port ??