我知道不建议将 Kestrel Web 服务器暴露给外界,但将 Kestrel 置于 IIS 之后所损失的性能并不是一件可以轻易忽略的事情。 (事实上 ,迁移到 .net core 可能会失去所有获得的性能。)
所以我想尝试一下:
我想知道在将 Kestrel 暴露给外界时,我是否应该注意一些事情,特别是在安全方面?
提前致谢。
安全风险的定义有些模糊,但基本的答案是 Kestrel 没有更成熟的 Web 服务器(如 IIS)所具有的针对攻击的强化能力。
文档中提供了完整的说明:https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/ .这是相关部分:
The most important reason for using a reverse proxy for edge deployments (exposed to traffic from the Internet) is security. Kestrel is relatively new and does not yet have a full complement of defenses against attacks. This includes but isn't limited to appropriate timeouts, size limits, and concurrent connection limits.
我是一名优秀的程序员,十分优秀!