I have a ASP.NET Core service build in .Net 5 which uses Kestrel as edge server. The service needs to listen on multiple domains on HTTP protocol - e.g. http://foo:12912
& http://bar:12912
and HTTPS protocol like http://foo:443
& http://bar:443
.
I know we can do with UseUrls
in Program.cs
.
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseUrls("http://foo:12912", "http://bar:12912");
});
}
However - given that Kestel has evolved so much - there should be a way to configure this from json config itself. All config examples that I could find only do for a single url like
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://foo:12912"
},
"Https": {
"Url": "https://foo:443"
}
}
}
The property name is also url
and not urls
so my assumption is that it only supports single url and not multiple. Is my expectation correct or am I missing something?