Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks

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 ??

share|improve this question

migrated from stackoverflow.com Jan 26 '11 at 10:48

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

Found out the last missing piece in the puzzle. I added vport=80 to the http_port line in squid.conf.

now everything is working properly for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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