Hi,
Need help with URL Rewrite. Been having the following errors for different applications on the same platform we are trying to expose:
1st Error
<div class="content-container"> <div class="hidden" id="section_detail"></div> </div>Second Error
<div class="content-container"> <div class="hidden" id="section_detail">Headers | Cache-Control: no-cache Pragma: no-cache Content-Type: text/xml; charset=utf-8 Expires: -1 Location: https://k2.reverseproxy.com/Designer/Utilities/AJAXCall.ashx?method=GetSessionDetails&_=1554758933016 Vary: Accept-Encoding P3P: CP='NON DSP COR' Set-Cookie: .ASPXAUTH=; expires=Mon, 11-Oct-1999 23:00:00 GMT; path=/; HttpOnly Set-Cookie: .ASPXAUTH=; expires=Sun, 08-Apr-2018 21:28:58 GMT; path=/ Set-Cookie: .K2AUTH=; expires=Sun, 08-Apr-2018 21:28:58 GMT; path=/ Set-Cookie: XSRFCookie=; expires=Sun, 08-Apr-2018 21:28:58 GMT; path=/ Set-Cookie: FedAuth=; expires=Sun, 07-Apr-2019 21:28:58 GMT; path=/ X-UA-Compatible: IE=11,IE=10,IE=9,IE=8 X-XSS-Protection: 1 X-Content-Type-Options: NoSniff X-Powered-By: ARR/3.0 |
---|
Buffer | <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="https://k2.reverseproxy.com/Designer/Utilities/AJAXCall.ashx?method=GetSessionDetails&_=1554758933016">here</a>.</h2> </body></html> <Exception ExtendedDetail="T" Title="Error" Description="An exception has occurred."><Type Name="Type">System.UnauthorizedAccessException</Type><Message Name="Message">The Anti-Cross Site Request Forgery token value is incorrect.</Message><Source Name="Source"><StackTrace Name="Stack Trace" /></Source></Exception> |
---|
BytesSent | 1366 |
---|---|
ErrorCode | The operation completed successfully. (0x0) |
Below is config used. This has been tested on my dev machine and works perfectly, but gives these errors when deployed to production where the IIS rewrite server is in the dmz.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<clear />
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://k2.denallix.com/(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="https://k2.reverseproxy.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
<action type="Rewrite" url="https://k2.denallix.com/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Thanks.