![]() |
1
41
Kestrel服务器头在请求管道中添加得太晚。因此,不可能通过web.config或中间件删除它。
您可以通过设置
AddServerHeader property
|
![]() |
2
50
此解决方案适用于iis10+版本,并允许删除
我们需要创造
然后在IIS上发布应用程序并重新启动站点。 |
![]() |
3
6
对于那些尝试执行相同操作(删除Kestrel web Server添加的服务器响应头)但使用ASP.NET core 2.2的用户,应该使用扩展方法 配置Kestrel ( https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.configurekestrel?view=aspnetcore-2.2#Microsoft_AspNetCore_Hosting_WebHostBuilderKestrelExtensions_ConfigureKestrel_Microsoft_AspNetCore_Hosting_IWebHostBuilder_System_Action_Microsoft_AspNetCore_Server_Kestrel_Core_KestrelServerOptions__ |
![]() |
4
4
对于Dotnet Core 3.1
|