Config IIS Url Rewrite ARR
Bonjour,
J'ai un IIS 7.5 configuré en reverse proxy à l'aide des modules "Url Rewrite" et "ARR 3".
J'ai une application développée en Asp.Net MVC Framework 4.5 hébergée sur IIS qui fonctionne très bien hormis lorsqu'il s'agit de rediriger l'utilisateur vers l'extérieur (autre host).
Par exemple, je fait une redirection vers : https://www.google.com/search?q=url+rewrite+iis+arr+3
Mon navigateur se retrouve sur http://localhost/search?q=url+rewrite+iis+arr+3
A l'aide de Fiddler j'ai récupéré la trace http suivante :
Citation:
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 350
Content-Type: text/html; charset=utf-8
Location:
http://localhost/search?q=url+rewrite+iis+arr+3
Server: Microsoft-IIS/7.5
X-Powered-By: ARR/3.0
X-Powered-By: ASP.NET
Date: Wed, 02 Nov 2016 16:39:18 GMT
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.google.com/search?q=url+rewrite+iis+arr+3">here</a>.</h2>
</body></html>
On voit bien dans le header le tag "Location" qui ne pointe pas sur le bon host.
Ma configuration IIS est la suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="IsRedirection" stopProcessing="true">
<match filterByTags="A" pattern="^http(.*)" negate="false" />
<action type="None" />
</rule>
<preConditions>
<preCondition name="IsRedirection">
<add input="{RESPONSE_STATUS}" pattern="3[0-9][0-9]" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration> |
Quelqu'un saurait-il m'apporter de l'aide sur ce sujet ?