Asked by:
Getting SSRS to work with ARR (Application Request Routing) URL Rewrite

Question
-
User1216435157 posted
I found an interesting article about setting up a reverse proxy in IIS 7 and ARR. I would like to use one external IP and route the user to multiple internal Report Servers:
My normal .asp pages are displayed using the proxy, but I have not been able to get my SSRS 2008 reports to show up. I can get to the list via http://<some_proxy_server>/ReportServer/Reports
However, except for some menu items, the report data is not displayed. Has anyone successfully gotten SSRS to work using ARR and URL ReWrite? Thanks.
Thursday, February 9, 2012 2:29 PM
All replies
-
User1702751832 posted
I know this is an old thread... Were you able to get URL rewrite working for your environment?
Thursday, November 7, 2013 11:54 AM -
User-1580627810 posted
In reference to this post: http://forums.iis.net/t/1186999.aspx
Our reason to get use ARR with IIS and URLRewrite is to
- Not expose our SQL Server to an external IP
- Use IIS URLRewrite to block calls not coming from a single HTTP_REFERER
Since SSRS is not hosted in IIS and it's own entity, URLRewrite does not apply directy to SSRS.
Our environment:
- IIS7
- SSRS 2012
- ARR 3.0
- URLRewrite 2.0
Sample SQL Server: SQL
Sample External Server: external.site.com
I followed the ARR + IIS + URLRewrite examples in many blogs. The result of the web.config was that
- Reports did not render the report;
- CSS Styles/Images were missing.
The web.config was similar to this and placed in the root of the 'external server'.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Route the requests for Report Server" stopProcessing="true">
<match url="^ReportServer/(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="{C:1}://<some server>/ReportServer/{R:1}" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule2" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://<some server>/ReportServer/(.*)" />
<action type="Rewrite" value="/ReportServer/{R:2}" />
</rule>
<rule name="RewriteRelativePaths2" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" />
<action type="Rewrite" value="/ReportServer/{R:1}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>Well, finally got it to work 100%, after scratching my head a lot and pulling some hair out... this is the correct web.config that makes it work.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.net>
<mailSettings>
<smtp from="xxxx">
<network host="xxxx" />
</smtp>
</mailSettings>
</system.net>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://sql/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://sql/(.*)" />
<action type="Rewrite" value="http{R:1}://external.site.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>Simply said...
- Go to IIS
- Create a Site
- At the Root of the Site, use URLRewrite
- In URLRewrite, create a new rule. Select the "Reverse Proxy" template
- Fill in the blank
- Tada....
Thursday, May 22, 2014 2:18 PM -
User-1603235805 posted
hi, sorry to resurrect this old thread. I'm trying to implement this on IIS 10 and SSRS 2014 but I'm getting an errror "HTTP Error 401.1 - Unauthorized, You do not have permission to view this directory or page using the credentials that you supplied."
will this work with a SSRS with forms authentication?
This is my configuration
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule12" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://dbserver.intranetdomain.com/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="^dbserver.publicdomain.com" />
</conditions>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://dbserver.intranetdomain.com/(.*)" />
<action type="Rewrite" value="http{R:1}://dbserver.publicdomain.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>Friday, January 27, 2017 5:35 AM