.net - Dotnet Core MVC 重写反向代理工作但现在 404.4
问题描述
我有一个托管在 Azure 上的 Dotnet Core MVC 应用程序。
有三个重写规则将代理内容从另一个网站反向到应用程序。
自从我上次部署以来,这在 Azure 上出现了问题,并且在我的本地开发环境中也出现了问题。
我假设已经有补丁或更新,就好像我遍历我的代码并重置为较旧的提交一样,反向代理规则仍然不起作用,但它们之前确实如此。
我已将我的应用程序交换回之前的部署槽,它现在可以工作,但我无法发布任何更改。
这是我的网络配置:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout">
<environmentVariables />
</aspNetCore>
<rewrite>
<rules>
<rule name="ProxyTrees" stopProcessing="true">
<match url="^trees/(.*)" />
<action type="Rewrite" url="http://x/trees/{R:1}" />
</rule>
<rule name="ProxyNurseries" stopProcessing="true">
<match url="^nurseries/(.*)" />
<action type="Rewrite" url="http://x/nurseries/{R:1}" />
</rule>
<rule name="ProxyCashAndCarry" stopProcessing="true">
<match url="^cash-and-carry/(.*)" />
<action type="Rewrite" url="http://x/cash-and-carry/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</location>
</configuration>
现在,当我访问 /trees /nurseries 或 /cash-and-carry 时,我收到错误 404.4
“您要查找的资源没有与之关联的处理程序。”
我真的很难过,因为通常有一个代码更改会导致这样的问题,但我真的找不到任何东西。
帮助表示赞赏!
解决方案
推荐阅读
- javascript - 为什么leaflet.js 在map.addlayer(layer) 上添加了不止一层?
- javascript - 使用 CefSharp 获取 xhtml 后停止内容加载
- java - 如何避免这种情况下的instanceof?
- visual-studio-code - VSCode 冻结并停止响应
- java - Log4j2:如何说服它 log4j-core.jar 的类确实存在?
- azure-devops - 如何允许运行时参数使用空字符串?
- javascript - 为什么使用 mywindow.print() 从 pdf 文件中排除图像?
- asp.net - 实体框架 1-1 和 1 至 *
- java - 如何检查数据库的 a 分支中是否存在子项,以便我可以根据该子项返回值
- java - 在不重新启动 jvm 的情况下阻止 java 代理