call container B inside container A using docker networks
If you have a user-defined network set to bridge, you can access other containers by their container's name which is automatically as hostname for containers inside same network.

So from containerA you could do ping containerB without problems. In your case it would be changing the setting to containerB_name:(container B needed port)/route