Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I want to do seems like it should be fairly simple. I would like to have one external address, and redirect to multiple different internal servers based on the login that the user uses.

That is, given users u1, u2, u3 and u4, I want them all to login to, and have users u1 and u2 internally redirected to and u3 and u4 redirected to

The logged in user should also be passed through so that the internal site knows which user is logged in. The internal sites will not be externally addressable.

I have looked at Perlbal, and that seems to allow some of what I want, but I can't see any option to redirect based on the logged in user. Mod_proxy also does not seem to allow this level of control.

What other options exist, or how can I make the aforementioned options do what I want?

share|improve this question
up vote 2 down vote accepted

Apache's mod_proxy could, in fact, do exactly what you want.

Its session-stickiness reads from cookie values; if all of the application servers know which server a user needs to go to (I'm not really clear on how the user distribution is decided, but we'll assume that it's stored or calculable), then it's simple.

Any server could give the user their server cookie on the first request. Say apache throws them to internal1, but they should be on internal2; the cookie can be something like SERVERID set to server.internal2. On the second request, with the below config, apache will see the cookie and send the user to the BalancerMember backend that is attached to the route defined in the cookie.

<Proxy balancer://domain>
    BalancerMember route=internal1
    BalancerMember route=internal2

ProxyPass / balancer://domain/ stickysession=SERVERID
ProxyPassReverse / balancer://domain/
share|improve this answer
That is nice. This cookie could also be set on the redirector after they login, so they wouldn't even need to go to the wrong box first. – Paul Wagland Mar 21 '11 at 22:19

Well I hope you have some programming knowledge...

The easiest way is to use a basic web server and make a login script using php/mysql.

When a user logs in you can use the header(Locaction:; to send the user to a different page.

To keep user data you can simply use cookies or (more advanced) cookies or one time links to the server and use the same database for the sites.

You can google for login scripts or ask on for more info. But I assume since you allready have the internal sites that either you or someone you know has programming experience.

share|improve this answer
I was hoping to find something off of the shelf that I just didn't know about… Coding is the fallback option, but certainly an option. – Paul Wagland Mar 21 '11 at 22:10

Your Answer


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.