我们正在使用 Windows Azure Web 角色来托管我们的 MVC 3 应用程序。从 SO 上的许多与性能相关的问题中,我发现 URL 重写模块可能会对 MVC 3 应用程序产生性能影响,即使不使用也是如此。
话虽如此,web.config 或 ServiceDefinition 文件中是否有办法禁用或删除 Azure 上的 URL 重写模块?我考虑过的一种方法是在启动时使用 .cmd 文件,类似于我们用来延长应用程序的应用程序池超时和回收周期的方法,但找不到禁用该模块的命令行方法。
URL Rewrite on by default on Azure Web Roles
最佳答案
您使用的是哪个版本的 SDK? 1.3 及更高版本默认不安装它。请参阅文档 here :
If you wish to use the IIS URL Rewrite module, you must install it and configure your rewrite rules. See URL Rewrite Module for more information.
更新:
我已经仔细检查过,似乎 URL Rewrite 2 仍然安装在 Web 角色上(我使用的是 1.7 SDK)。要卸载 URL 重写,请创建一个执行以下命令的启动任务(提升):
wmic product where name="IIS URL Rewrite Module 2" call uninstall
关于asp.net-mvc-3 - 禁用/关闭 Windows Azure Web 角色中的 URL 重写模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11954103/