Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Håvard Hovind 9 posts 89 karma points
    Oct 05, 2018 @ 17:16
    Håvard Hovind

    umbracoApplicationUrl and https


    I am forcing a redirect from http to https with iis rules.

    This is working fine, but it seems like the scheduled keepalive function in Umbraco returns an error, filling up the tracelog. Somehow my application url ends up as a http url.

    I understand that setting an https url explicit in umbacoApplicationUrl (in web.routing) could solve this.

    But, how can I do this dynamically? I have a lot of different environments (local + azure) with different URLs, and it would be great if it was possible to set this dynamically somehow, either through some kind of app service setting or if it just figured out whatever application url it has but using https instead of http.

  • Marc Goodson 1890 posts 12512 karma points MVP 7x c-trib
    Oct 05, 2018 @ 19:37
    Marc Goodson

    Hi Havard

    Essentially the rules for setting the umbracoApplicationUrl are that Umbraco will first look at the WebRouting settings, if this is blank it will look for the baseUrl (int the old scheduledtask settings) and then will look for any custom IServerRegistrar2 implementations that set the value in code, and finally it will just take the url of the first request the site receives after an application pool recycle.

    So if you want to set the value in code, based on some conditions on your site, then you can do this by leaving the WebRouting settings blank, and implementing an IServerRegistrar2 implementation:


    putting your custom logic for setting the value in the

    public string GetCurrentServerUmbracoApplicationUrl()
    // return my url


    but if the first request to the site is what you are after for the Url, then just leave all the config empty!

  • Håvard Hovind 9 posts 89 karma points
    Oct 05, 2018 @ 20:43
    Håvard Hovind


Please Sign in or register to post replies

Write your reply to: