首页 新闻 会员 周边

.net MVC core自启动模式Kestrel,可以同时支持http和https吗

0
[待解决问题]

现在是用https登录,请问如何能同时可以用http和https两种方式访问?(域名端口最好一致)

var host = new WebHostBuilder()
                .UseKestrel(option => {
                    option.UseHttps("server.pfx", "820722lb");
                })
                .UseUrls("https://*:8123")
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .UseApplicationInsights()
                .Build();

 

目前是这样,如果在UseUrls中追加一个"http://*:8123"会提示已经有了

pappercut的主页 pappercut | 菜鸟二级 | 园豆:204
提问于:2017-04-01 10:19
< >
分享
所有回答(2)
0

建议用反向代理,windows上用IIS,linux上用nginx

dudu | 园豆:31003 (高人七级) | 2017-04-01 11:00
0

http和https还能用相同的端口?

你可以试试追加一个不一样的http端口试试

诶碧司 | 园豆:1912 (小虾三级) | 2017-04-01 12:11
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册