schwermie wrote:
At our company we have a complex setup.
external URL internal URL
www.example.com/ -> www.example.com
www.example.com/subdir -> www.example2.com
www.webserver.com -> www.example.com/webserver
www.server.com:1800 -> www.server.com:1800
Could someone help me, i don't know how to create a config for this
scenario.
Thanks...
1) You will _really_ want get rid of the:
www.webserver.com -> www.example.com/webserver
2) Next, make sure that the app/machine at www.example2.com is able to
handle requests for "www.example.com/subdir"
Squid can easily forward requests based on any criteria to any source
for interpretation, but as soon as it has to re-write a URL things get
nasty fast.
If you are 100% unable to fix those two linkages, you can look at a
url_rewriter for them. But be wary as it will ONLY rewrite the requested
URL, not any page contents, or other headers referencing the external URL.
Not ugly, just nasty. Everything looks peachy then an individual page
form or 3xx header kicks you.
3)
Take a read of
http://wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers
get squid listening on normal and that one weird port:
http_port 80 accel vhost defaultsite=example.com
http_port 1800 accel vhost defaultsite=www.server.com
define 3 peers:
www.example.com:80
www2.example.com:80
www.server.com:1800
use the ACL to match the incoming URL pieces (dstdomain and one "urlpath
-i /subdir" to match the particular set of domain/path and route
requests to only the relevant peer.
4) test. test. test.
5) point DNS at squid.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
Current Beta Squid 3.1.0.6