在IIS URL重写模块可能的错误还是只是我?

好吧,所以我想出了一个很好的主意,运行带有重写规则的W2012 IIS8来为我做一些反向代理,不是因为它是最好的select,而是因为我不想另一个盒子解决另一个问题。

我设法让所有这些都非常漂亮地运行,有两个子目录链接到两个后端Linux服务器,所有的出站标记似乎都被重写了,就像应该一样。 直到我试图login,并意识到它跳过一些表单域。

在漫长的一夜之后,我设法find了什么触发了重写引擎不处理这种情况下的表单,而更多的是与连字符或下划线相关的属性。 我的Linux网站正在生产的forms包含该行

<form accept-charset="UTF-8" action="/login" ... 

当然包含一个hyphened属性。

所以,我着手弄明白这个:

/test/default.htm

 <html> <a href="/ahrefpage.htm">This ahref has no dummy attribute</a> </br> <a dummy="x" href="/ahrefpage.htm">This ahref has a dummy attribute</a> </br> <a dum-my="x" href="/ahrefpage.htm">This ahref has a hyphen dummy attribute</a> </br> <a dum_my="x" href="/ahrefpage.htm">This ahref has an underscore dummy attribute</a> </br> </html> 

用下面的web.config

 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <outboundRules> <rule name="OutboundRewriteTestPage" preCondition="isHtml" enabled="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" customTags="" pattern="^/(.*)" /> <action type="Rewrite" value="/test/{R:1}" /> </rule> <preConditions> <preCondition name="isHtml"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> </preCondition> </preConditions> <customTags> </customTags> </outboundRules> </rewrite> <urlCompression doStaticCompression="false" doDynamicCompression="false" /> </system.webServer> </configuration> 

所以,最终的页面是这样的

 This ahref has no dummy attribute https://portal.xx.com/test/ahrefpage.htm This ahref has a dummy attribute https://portal.xx.com/test/ahrefpage.htm This ahref has a hyphen dummy attribute https://portal.xx.com/ahrefpage.htm This ahref has a underscore dummy attribute https://portal.xx.com/ahrefpage.htm 

所以基本上问题是,这是一个在Linux上运行良好的技术的又一个不好的实现,或者我错过了什么? 有没有一个解决方法 – 除了修改源材料,这打破了目的。

谢谢,Chris.J