Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

UseIISIntegration should set IServerAddresses.PreferHostingUrls #352

Closed
Tratcher opened this issue Apr 6, 2017 · 2 comments
Closed

UseIISIntegration should set IServerAddresses.PreferHostingUrls #352

Tratcher opened this issue Apr 6, 2017 · 2 comments

Comments

@Tratcher
Copy link
Member

Tratcher commented Apr 6, 2017

When running behind IIS ANCM should override any Kestrel endpoint configuration by setting PreferHostingUrls

hostBuilder.UseSetting(WebHostDefaults.ServerUrlsKey, address);

This can clean up some ugliness from Program.Main:
https://github.com/aspnet/Security/blob/2d7cd6038fea34b84084685648ac9d0c97be610b/samples/SocialSample/Program.cs#L19

See aspnet/Hosting#992
@JunTaoLuo

@shirhatti
Copy link
Contributor

Especially given the fact we are injecting UseIISIntegration, this makes me a little uncomfortable. Anything we can do to improve discoverability around this behavior?

@JunTaoLuo
Copy link
Contributor

@shirhatti The servers will log if server addresses are used to override the endpoint configurations. We can have UseIISIntegration log that it's setting the PreferHostingUrls flag. Other than that, I can only think of updating docs to make this behaviour more clear.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants