I've created a web application on my sharepoint farm: sharepoint.local Name: https://app.sharepoint.local
Outside of my farm the site is available through an UAG server on:
https://app.publicurl.com
(UAG/AAM pointing to the internal url)
In my code behind I use the current url to specify my web app url and execute some code. I was wondring how I could dynamically retrieve my web app url if users are using the public url: https://app.publicurl.com
Are there out of the box functions for this?