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 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: mysite.com/messenger)

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 mysite.com/phone ... is this something I should do with HAProxy or with lighttpd?

Thanks in advance.

share|improve this question

1 Answer 1

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

 
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.