0

I have a server setup that runs two applications, one on symfony (php) and one on express (node). The php application by default has been running on apache2. But now I would like to run both applications with the root url / redirecting to the node server and a particular child route eg /abc pointing to the symfony server with another child route /xyz pointing to my node server. Basically my application is currently having pages and routes on both node and php.

I have been able to do this on my production server using an AWS ELB but wanted to do it using apache on the development server

I have already researched a lot about this but haven't been able to find this particular use case.

I have already tried using ProxyPass and ProxyPassReverse, but all those example either serve the node application on a child route eg: /node and not on the root url / or redirect the complete application to the node server from where apache cannot redirect a child route back to symfony.

Any help will be highly appreciated.

Deepank
  • 717
  • 2
  • 8
  • 15
  • 1
    look here too https://stackoverflow.com/questions/9831594/apache-and-node-js-on-the-same-server – Jordan Georgiadis Jun 26 '18 at 07:38
  • I've already seen all these. Unfortunately, my use case is a little different. All these answers send the node request to a separate url and not the root url. I need to send the root url request to the node server and the sub routes to node and symfony server selectively. I hope I'm making myself clear. – Deepank Jul 01 '18 at 14:38

1 Answers1

0

There are many way about using Apache & NodeJS together

https://atticuswhite.com/blog/apache-serving-nodejs/

Apache and Node.js on the Same Server

D. Schreier
  • 1,700
  • 1
  • 22
  • 34