-
-
Save 7u4/8dbd60a04987c44c2281 to your computer and use it in GitHub Desktop.
Proxy using IIS to TeamCity site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request: | |
Proxy to teamcity. Use a proxy in IIS and redirect "input" to "output". | |
Ideas: | |
http://jonalb.com/post/2010/10/23/TeamCity-On-Port-80-In-IIS.aspx | |
http://www.wrapcode.com/infrastructure/configure-reverse-proxy-with-url-rewrite-and-arr-for-iis/ | |
Solution: | |
- Create an empty site in IIS | |
(Powershell) New-Item iis:\Sites\ci-bindings @{protocol="http";bindingInformation=":6500:ci"} -physicalPath C:\inetpub\wwwroot\ci | |
- Installs in IIS needed addins for ARR (Application request routing), using Mwpi (Microsoft Web Platform installer) | |
- Activate the use of proxys settings in the server | |
- Edit site "web.config" and add the next "input" and "output" rules to redirect all requests to the site of teamcity. You can do this manually to: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Inbound Rule"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{CACHE_URL}" pattern="^(https?)://" /> | |
</conditions> | |
<serverVariables> | |
<set name="HTTP_ACCEPT_ENCODING" value="True" /> | |
</serverVariables> | |
<action type="Rewrite" url="http://localhost:6000/{R:1}" logRewrittenUrl="true" /> | |
</rule> | |
</rules> | |
<outboundRules> | |
<rule name="Outbond" preCondition="ResponseIsHtml1"> | |
<match filterByTags="A, Area, Base, Form, Frame, Img, Input, Link, Script" pattern="^http(s)?://localhost:6000/(.*)" /> | |
<action type="Rewrite" value="{R:1}" /> | |
</rule> | |
<preConditions> | |
<preCondition name="ResponseIsHtml1"> | |
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> | |
</preCondition> | |
</preConditions> | |
</outboundRules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment