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.

Here's the setup. We have a hardware load balancer with an http virtual cluster. Let's call this virtual cluster example1.com. This virtual cluster load balances between two squid reverse proxies which are also on the same physical servers as the web servers. Squid listens on 80 and points to itself as the cache_peer web server which listens on 81. We also have a standalone web server which we will call example2.com.

What we are trying to do is create a subdirectory on example1.com called example1.com/example2. This will point to example2.com, but we want our users to stay at example1.com/example2 in their browser. So, it's like a redirect without actually being a redirect. How the hell do I go about doing this? Is this even possible? I'm looking at squid docs in the meantime.

  • example1.com is running a proprietary web server - not Apache :(
  • We can't host example2.com's content in example1.com's file system. These are two very different platforms.
share|improve this question
    
Almost need a picture here or something. Your setup is pretty complex. Since I am not sure I have fully grasped your setup, I am not sure if I can provide a valid answer. But have you looked at using the redirection features within Squid? When squid redirects it is transparent to the end user. See: wiki.squid-cache.org/Features/Redirectors –  Zoredache Nov 30 '12 at 23:28
add comment

2 Answers

I might be missing something here, but this actually sounds pretty straight forward. Load balance all requests where the URL path matches ^/example2/ to the example2.com web server.

Move all website content from the directory root to a subdirectory called /example2/ on the example2.com web server.

share|improve this answer
    
Mathias, you are absolutely correct. I incorporated some of your answer into my config file. Thanks. –  Coobadivin Dec 4 '12 at 16:08
add comment
up vote 0 down vote accepted

I got it working. I reconfigured squid to use a urlpath_regex acl and set up example2.com as a secondary cache peer. Then I set example2.com to allow /example2, but deny all others. Then for example1.com, I set it to deny /example2. It's working as intended. Here's what the config file looks like.

acl redirect urlpath_regex ^/example2*

cache_peer example1.com parent 81 0 no-query originserver name=server1
cache_peer example2.com parent 80 0 no-query originserver name=server2

cache_peer_access server1 deny redirect
cache_peer_access server2 allow redirect
cache_peer_access server2 deny all

If I go to example1.com/example2, it's pulling the content from example2.com, but the example1.com URL remains in the browser.

share|improve this answer
add comment

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.