U4-6788 - OriginalRequestUrl confusion

Created by Stephan 03 Jul 2015, 08:06:25 Updated by Shannon Deminick 09 Jul 2015, 16:40:38

Relates to: U4-5728

The point of ApplicationContext.OriginalRequestUrl is really to let the server know how it should talk to itself (ie it should be named eg ThisServerUrl). And by default, we "guess" the value from the first request.

The scheduledTasks/@baseUrl config overrides that setting, so keepAlive &co know how to reach the server. But we still set OriginalRequestUrl from the first incoming request and that would be why in some cases, we can see the message "Setting OriginalRequestUrl: localhost:80/umbraco" even though BaseUrl is set. this is confusing.

If BaseUrl is set, we should use it to initialize OriginalRequestUrl, entirely bypassing the "guess from first request" thing.

It should be ApplicationContext.ThisServerUrl that by default is guessed from the first request, but can be forced with a ThisServerUrl config of some sort, that's not only for scheduled tasks.


Stephan 06 Jul 2015, 12:02:34

@Shandem: you may want to review commit 8c54f2edc99ba12a5cf3b2725859b209e48acc87

ApplicationContext.OriginalRequestUrl is gone and replaced by ApplicationContext.UmbracoApplicationUrl which is the fully qualified url where the current Umbraco application can be reached, eg "https://my-site.com/umbraco". It is initialized from

  • umbracoSettings:settings/web.routing/@umbracoApplicationUrl if it exists
  • else umbracoSettings:settings/scheduledTasks/@baseUrl if it exits
  • else umbracoSettings:distributedCall/servers if we have the server in there
  • else the first request that comes in

ServerEnvironmentHelper.GetCurrentServerUmbracoBaseUrl() is gone, as now ApplicationContext.UmbracoApplicationUrl should be used everywhere.

Shannon Deminick 09 Jul 2015, 16:40:31

I've had a look and all seems good, will close. Have backported this to 7.2.7 as well.

Priority: Normal

Type: Bug

State: Fixed

Assignee: Stephan

Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.6

Due in version: 7.2.7


Story Points: