Web Farm Rewrite rules in web.config files

on Saturday, October 19, 2013

It looks like when Web Farm Framework was folded into the ARR module (http://www.iis.net/downloads/microsoft/application-request-routing) there was a nice feature update that allowed for the Web Farm Rewrite rules (eg. “rewrite” to “http://XXXWebFarm/{R:0}”) to be set within the web.config files of individual websites on your proxy server. At least, I think it was implemented during that transition; it may have been earlier.

This is a pretty nice feature that can really alter the way URL Rewrite rules are managed on the proxy server. If the rewrite rules are only available within the applicationHost.config file, then all rules need to be centrally managed through that one file. This could lead to 1000’s of lines of xml rules for probably less than 100 sites.

Having the ability to move site specific rules into web.config files for those sites doesn’t change that each “type” of rule needs to have a defined policy on how it will be implemented and managed. But, it will make discovery and management of the rules simplified and easy to understand. This is a pretty nice improvement.

The improvement also allows for global rules to continue to be defined within the global applicationHost.config (ie. setting variables), which can be reused in the individual site web.config rules. So, the best of both worlds.

A big thanks to my coworker Keith Jakobs for discovering this!

0 comments:

Post a Comment


Creative Commons License
This site uses Alex Gorbatchev's SyntaxHighlighter, and hosted by herdingcode.com's Jon Galloway.