0

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.

1 Answers1

0

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.

Khaled
  • 35,688
  • 8
  • 69
  • 98