Deployment mobile server

Here is the situation. I have a living server and testing server. The testing server used for test updated function. Both have own ROOT_URL. So TestFlight version so using production URL but updated function. How to solve this problem?