我希望我的网站默认为HTTPS,除了服务(.asmx和 .svc)在Http和Http中工作。
由于客户端是在jsp中开发的,并且使用http请求,因此一些REST服务将是http,一个客户端是Windows,它使用与https相同的服务。
我要跳过**.asmx和.svc**或特定服务,以便任何客户端都可以在http或https中请求服务。
我使用下面的代码:
<rule name="Force HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<!-- <add input="{HTTPS}" pattern="^OFF$" /> -->
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/myservice.svc$" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/myservice.svc?(.*)" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/restserv.svc$" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/restserv.svc/(.*)" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
它们都不起作用:只有 /myservice.svc 在http中工作,但当用户点击参数**/myservice.svc?wsdl或/myservice.svc/getdata/user-name**时,它会转发到https。restserv.svc也会发生同样的情况
如何跳过 *.svc或我的特定服务跳过参数?
2条答案
按热度按时间oxf4rvwz1#
您可以尝试以下规则:
如果您仍然面临问题,请尝试在iis中运行失败请求跟踪:
使用失败请求跟踪来跟踪重写规则
wyyhbhjk2#
这是我在asmx Web服务中使用的规则,允许使用“?wsdl”或类似的语句: