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

I have a website that is split into two different servers:

  1. chat server in node.js
  2. normal website (lighttpd + php + whatever)

now, I have set HAProxy in the same machine as node.js chat, so that when my website is accessed, it will redirect to the chat login. (Eg:

What I want to do now is to put a link on the chat page to send to the other part of the website which has a normal files tree, like home.php, photos.php, settings.php, etc. but I really have no clue how this whole redirection works.

Also, what about URL rewriting? If I have like info.php?item=phone and want to change it to ... is this something I should do with HAProxy or with lighttpd?

Thanks in advance.

share|improve this question
up vote 0 down vote accepted

Haproxy has many options that enable you to redirect the traffic to specific backend server(s) based on many different parameters (such as the URL).

You can create ACL based on the URL you want and then redirect the traffic to the desired backend server(s) if a request matches this ACL.

As for URL rewriting, it can be done at haproxy level and also it web server level. The recommended approach is to do it at web server level as stated by haproxy documentation. Your system should still work even after removing haproxy.

share|improve this answer

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.