I have two HTTP servers. One of them (A) is listening to port 3000 and the other one (B) is listening to port 4000. Also, I have two domains example1.com and example2.com. In the other hand, I have nginx server listening at port 80.
I would like to get responses from server A when the request is using example1.com domain and responses from server B when the request is using example2.com.
How should I configure nginx?