ReactPHP without Nginx? #470
-
What's the best approach for pointing sub domains at reactphp/http servers on the same ip? Nginx? Or can I do something funky with reactphp? The usecase is breaking things into microservices: Say I have 3 API servers running on the same machine. I want to call these servers from a javascript client via https://auth.domain.name, https://api.domain.name, https://lookup.domain.name. I know I can set up Nginx to do this, but I want to understand if this is the best approach, or if there would be an advantage using another ReactPHP server as a gateway/proxy? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hey @michaelphipps, I think in this case I would recommend using something like nginx for this. It is possible using the ReactPHP server, but you should be careful what requests to accept . You have to set up the whole security/encryption part for this server by yourself, which is not an easy task to do and could lead to security issues for your microservices. I guess you could run this behind a reverse proxy, but I personally would go with the easy option here. Nginx for example does all this already, that's why I'm recommending it. 👍 |
Beta Was this translation helpful? Give feedback.
-
I'm running 10 reactphp/http wrapped in SF command + supervisor with HAProxy on top 2k req/s no sweat ;p haproxy is handling the SSH termination so behind it must be safe (like a DMZ). I used nginx at first but there was some buffering issue with the public branch of nginx (too much magic). |
Beta Was this translation helpful? Give feedback.
Hey @michaelphipps, I think in this case I would recommend using something like nginx for this. It is possible using the ReactPHP server, but you should be careful what requests to accept . You have to set up the whole security/encryption part for this server by yourself, which is not an easy task to do and could lead to security issues for your microservices. I guess you could run this behind a reverse proxy, but I personally would go with the easy option here.
Nginx for example does all this already, that's why I'm recommending it. 👍