Asp.Net Core发布绑定域名和端口

一.WebHostBuilder配置URL和端口进行侦听 UseUrls()

1.默认的ASP.NET Core项目绑定http://localhost:5000。通过使用UseUrls扩展方法——编辑urls命令行参数

2.指定格式:http://xxx:xxx,如:http://*:81

var host = new WebHostBuilder()
    // .UseUrls("http://localhost:5003","http://www.sqlme.com:80")
    //.UseUrls("http://*:8000")
    .UseUrls("http://www.sqlme.com:8000")
    .UseKestrel()
    .UseContentRoot(Directory.GetCurrentDirectory())
    .UseIISIntegration()
    .UseStartup<Startup>()
    .UseApplicationInsights()
    .Build();

3.如果当前机器已经安装了IIS等服务器软件,那么监听 80端口就会抛出异常。

4.如果使用不同的域名共享一个 端口,可以参考WebListener

二、关于ASP.NET Core WebListener 服务器

WebListener支持以下功能:

  • Windows Authentication
  • Port sharing
  • HTTPS with SNI
  • HTTP/2 over TLS (Windows 10)
  • Direct file transmission
  • Response caching
  • WebSockets (Windows 8)

支持的Windows版本:

  • Windows 7和Windows Server 2008 R2和更高版本

 

更多 :

.Net Core邮件发送之MailKit

Asp.Net Core WebAPI入门整理(三)跨域处理

Asp.Net Core中Json序列化处理整理

转载于:https://www.cnblogs.com/tianma3798/p/6942098.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值