Xslt 了解IIS代理响应头重写规则
我们有一个IIS反向代理响应规则,它修改位置HTTP头。。我试图解码逻辑并计划用xslt编写相同的逻辑,有人能解释一下下面的逻辑吗。匹配模式如何工作,动作重写和值如何工作,这里的R:1、R:2、R:3是什么Xslt 了解IIS代理响应头重写规则,xslt,iis,url-rewriting,reverse-proxy,Xslt,Iis,Url Rewriting,Reverse Proxy,我们有一个IIS反向代理响应规则,它修改位置HTTP头。。我试图解码逻辑并计划用xslt编写相同的逻辑,有人能解释一下下面的逻辑吗。匹配模式如何工作,动作重写和值如何工作,这里的R:1、R:2、R:3是什么 <rule name="Change Location Header" enabled="true"> <match serverVariable="RESPONSE_LOCATION" pattern="^http(s)?://([^/
<rule name="Change Location Header" enabled="true">
<match serverVariable="RESPONSE_LOCATION" pattern="^http(s)?://([^/]+)/(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="true">
<add input="{RESPONSE_STATUS}" pattern="^301" />
<add input="{RESPONSE_STATUS}" pattern="^302" />
</conditions>
<action type="Rewrite" value="http{R:1}://{R:2}/{R:3}" />
</rule>
您的规则正在更改HTTP位置标头中用于重定向响应的域 工作配合情况如何?R:1、R:2、R:3是什么 RESPONSE_位置变量具有完整的lik url。例如:
https://demo.cloudimg.io/s/width/300/sample.li/boat.jpg
在这种情况下,使用regexp进行匹配操作后:^https?://[^/]+/*
Mathces将是这样的:
{R:0} https://demo.cloudimg.io/s/width/300/sample.li/boat.jpg
{R:1} s
{R:2} demo.cloudimg.io
{R:3} s/width/300/sample.li/boat.jpg
嗨,维克多,谢谢你的回复,我真的很感激。我可以知道在xslt中使用regex replace可以实现的samething的修改位置头值是多少吗