简体   繁体   中英

Elastic Beanstalk Multicontainer Docker Environments: redirect requests between 2 APIs

I have a multicontainer Docker environment on Amazon Elastic Beanstalk. This env include 2 APIs container - PHP and node. The reason for that is we have all previously implemented logic and end points in php, however all new end points are made in nodejs. Now I would like to setup redirection that the existence of 2 API containers would be transparent for the client. For example when the client queries server/login it would be redirected to the php container, when server/register to the node one. Thus redirection should be determined based on endpoint. What is the best approach to implement this? Thank you in advance.

Best approach is relative.

Nginx or haproxy in front are your best bet for swapping backends based on URL rules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM