使用iisnode对动词PUT和DELETE进行URL重写 [英] URL Rewrite in case of verbs PUT and DELETE with iisnode
问题描述
这是我的
直接在 web.config
的 system.webServer
内部作为文本:
< security>< requestFiltering><动词>< add verb ="PUT";allowed ="true"/>< add verb ="DELETE"allowed ="true"/></动词></requestFiltering></security>
This is a follow-up question to my previous one, focused on the fact that I'm getting a 404 error when I try to call a DELETE or a PUT verb for an Node.JS application on IIS configured with iisnode and URL Rewrite as follows:
<handlers>
<add name="iisnode" verb="*" path="app.js" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="my app rule" stopProcessing="true" patternSyntax="Wildcard">
<match url="*" />
<action type="Rewrite" url="app.js" />
</rule>
</rules>
</rewrite>
The script app.js is not even called, the url is not rewritten.
Is it a well known bug or what else am I supposed to do?
No issues for GET and PUT verbs instead (and of course I've already implemented a workaround using the latter).
That was due to the Request Filtering of IIS (tab HTTP Verbs)
Added there the missing verbs as shown in the screenshot below and problem solved.
As text, directly inside the system.webServer
of the web.config
:
<security>
<requestFiltering>
<verbs>
<add verb="PUT" allowed="true" />
<add verb="DELETE" allowed="true" />
</verbs>
</requestFiltering>
</security>
这篇关于使用iisnode对动词PUT和DELETE进行URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!