简体   繁体   English

通过ARR和URL重写了解iis路由

[英]Understanding iis routing with ARR and Url Rewrite

I know how to configure IIS using URL Rewrite in combination with Application Request Routing in order to share an URL between different services running on different ports on one machine. 我知道如何结合使用URL重写和应用程序请求路由来配置IIS,以便在一台计算机上在不同端口上运行的不同服务之间共享URL。 Or rather I usually get it working after some tweaking. 或者更确切地说,我通常会在进行一些调整后使其正常工作。 However I don't really understand and am unable to explain why it works that way. 但是我不太了解,也无法解释为什么会这样。 For example, I don't understand why ARR is needed in addition to Rewrite. 例如,我不明白为什么除了重写外还需要ARR。

I can't find either ARR or Rewrite between the list of Handlers, but I guess they hook in at a higher level (before any handler is reached). 我在处理程序列表之间找不到ARR或重写,但是我猜想它们会挂接到更高的级别(在到达任何处理程序之前)。 ARR is only available at root level, while rewrite can also be done on a site node, so I assume that ARR is the first to receive a request? ARR仅在根级别可用,而重写也可以在站点节点上完成,因此我认为ARR是第一个接收请求的人吗?

I do find many resources on how to set it up, but nothing explaining how or why it works. 我确实找到了很多有关如何设置它的资源,但是没有任何解释它如何工作或为什么起作用的信息。 Could someone explain the flow? 有人可以解释流程吗? Which module (Rewrite or ARR) gets the request first, and how does it flow through the system? 哪个模块(重写或ARR)首先获得请求,它如何流经系统? When would one use only one of these modules separately? 什么时候可以仅单独使用这些模块之一?

As the acronym of ARR indicates, it's all about routing the requests. 正如ARR的首字母缩写所表明的那样,这全都与路由请求有关。 Typically, you can have ARR server(s) as a first entry point for all the requests coming to your company. 通常,您可以将ARR服务器作为所有进入公司的请求的第一个入口点。 ARR will then either redirect or route them to the right server farm. 然后,ARR将重定向或将它们路由到正确的服务器场。 For applying this logic, ARR provides usage of regular expressions, back-references, you can also make use of conditions and all of this is structured in rules. 为了应用此逻辑,ARR提供了正则表达式,反向引用的用法,您还可以使用条件,并且所有这些都由规则构成。

In my opinion, this is a much more powerful system developed to handle this kind of large-scale environment. 我认为,这是一个为处理此类大规模环境而开发的功能强大的系统。 Rewrite module is - I think - much simpler and only a subset of all we can do in ARR ; 重写模块-我认为-更简单,并且仅是我们在ARR中可以完成的所有工作的一部分; the goal is probably not the same. 目标可能不一样。

I hope it helps. 希望对您有所帮助。 At least it's what I've seen from my own experience with ARR, mainly. 至少主要是从我自己的ARR经验中看到的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM