{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:80"
},
"Https": {
"Url": "https://0.0.0.0:443",
"Certificate": {
"Path": "certs/server.pfx"
"Password":"xxxxxxxxx"
}
}
}
},
"AllowedHosts": "*"
}
说明:
80为http默认端口
443为https默认端口
两个端口同时监听后,http收到的请求会自动跳转到https
0.0.0.0表示监听本机所有IP地址
certs/server.pfx 表示相对路径certs文件夹下的server.pfx文件
本文详细描述了在ASP.NETCore中设置日志级别,Kestrel服务器端点,包括HTTP和HTTPS,以及如何配置允许所有主机并使用自签名的server.pfx证书。HTTP请求将被自动重定向至HTTPS。
70

被折叠的 条评论
为什么被折叠?



