I maintain two Debian Linux servers, A and B. A is rather old and runs a old PHP installation (5.4), while B runs a newer (7.2). Both run Apache as a web server. Server A uses PHP as a module, while server B uses PHP FPM.
What I'd like to do is to have the same domain name for both servers, eg. mydomain.com. When a visitor requests mydomain.com/pathA the response should originate from server A, while requests to mydomain.com/pathB the responses must originate from server B.
I've read that nginx can do this. If there's a third server, eg. C with nginx installed, it could act as a reverse proxy for both servers.
First of all, is what I think possible with nginx? If so, could you please point me to some examples for configuring nginx to work like this?
Thank you.