Account for appliation server internal forwarding when obtaining the client url

Account for appliation server internal forwarding when obtaining the client url