c# - Azure - 删除服务器”和“x-powered-by”.net core 3.1
问题描述
我正在 Azure 中部署 webapi (.net core 3.1)。我读了这篇文章... 如何删除 .net core 2.0 中的 x-powered-by 标头 和 删除 ASP.Net Core 2.2 InProcess 上的 HTTP 标头
我创建了 web.confi,并在发布时进行了输出,文件在此处创建“...\obj\Debug\netcoreapp3.1\PubTmp\Out”,其结构如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering removeServerHeader="true" />
</security>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\xdws.dll" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
</system.webServer>
</configuration>
但是,仍然显示“服务器”和“x-powered-by”信息,就像这张图片一样。
解决方案
推荐阅读
- python - macOS Catalina Jupyter 笔记本中的权限问题
- shopware - Shopware 6:禁用 cookie 同意
- javascript - 将第二个指令绑定到同一数据对象时出现 react2angular 问题(它们控制彼此的值)
- php - 无法使用 phpmailer 发送邮件
- sql - Snowflake SQL 按最近滚动 30 天的事务过滤
- autokey - 如何在 AutoKey 中用相同的缩写替换短语
- spring - 在 Spring Junit 测试中加载 ApplicationContext 失败
- ajax - Laravel/Ajax 删除功能成功后不刷新我的表
- android - 关于 FullScreenContentCallback 的问题
- python - 在请求中添加路径参数