Skip to content

Commit ea80c63

Browse files
committed
Add iis web.config files.
1 parent 4bf3000 commit ea80c63

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

iis/web.config

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<configuration>
2+
<system.webServer>
3+
<rewrite>
4+
<rules>
5+
<rule name="customstart.page-ReverseProxyInboundRule1" stopProcessing="true">
6+
<match url="(.*)" />
7+
<conditions>
8+
<add input="{HTTP_HOST}" pattern="^customstart\.page$" />
9+
</conditions>
10+
<action type="Rewrite" url="http://customstart.local:1234/{R:1}" />
11+
</rule>
12+
<rule name="customstart.page-ReverseProxyInboundRule2" stopProcessing="true">
13+
<match url="(.*)" />
14+
<conditions>
15+
<add input="{HTTP_HOST}" pattern="^(.*)\.customstart\.page$" />
16+
</conditions>
17+
<action type="Rewrite" url="http://{C:1}.customstart.local:1234/{R:1}" />
18+
</rule>
19+
20+
<rule name="cs.local-ReverseProxyInboundRule1" stopProcessing="true">
21+
<match url="(.*)" />
22+
<conditions>
23+
<add input="{HTTP_HOST}" pattern="^cs\.local$" />
24+
</conditions>
25+
<action type="Rewrite" url="http://customstart.local:1234/{R:1}" />
26+
</rule>
27+
<rule name="cs.local-ReverseProxyInboundRule2" stopProcessing="true">
28+
<match url="(.*)" />
29+
<conditions>
30+
<add input="{HTTP_HOST}" pattern="^(.*)\.cs\.local$" />
31+
</conditions>
32+
<action type="Rewrite" url="http://{C:1}.customstart.local:1234/{R:1}" />
33+
</rule>
34+
</rules>
35+
<outboundRules>
36+
<rule name="customstart.page-ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
37+
<match filterByTags="A, Form, Img, Script" pattern="^(//)?customstart.local(:)?(1234)?(/)?(.*)?" />
38+
<action type="Rewrite" value="//customstart.page/{R:5}" />
39+
</rule>
40+
<rule name="customstart.page-ReverseProxyOutboundRuleSubdomain1" preCondition="ResponseIsHtml1">
41+
<match filterByTags="A, Form, Img, Link, Script" pattern="^(//)(.*)\.?customstart.local(:)?(1234)?(/)?(.*)?" />
42+
<action type="Rewrite" value="//{R:2}customstart.page/{R:6}" />
43+
</rule>
44+
45+
<rule name="cs.local-ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
46+
<match filterByTags="A, Form, Img" pattern="^(//)?customstart.local(:)?(1234)?(/)?(.*)?" />
47+
<action type="Rewrite" value="//{R:2}cs.local/{R:5}" />
48+
</rule>
49+
<rule name="cs.local-ReverseProxyOutboundRuleSubdomain1" preCondition="ResponseIsHtml1">
50+
<match filterByTags="A, Form, Img, Link" pattern="^(//)(.*)\.?customstart.local(:)?(1234)?(/)?(.*)?" />
51+
<action type="Rewrite" value="//{R:2}cs.local/{R:6}" />
52+
</rule>
53+
54+
<preConditions>
55+
<preCondition name="ResponseIsHtml1">
56+
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
57+
</preCondition>
58+
</preConditions>
59+
</outboundRules>
60+
</rewrite>
61+
</system.webServer>
62+
</configuration>

iis/web.config.iisnode

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<configuration>
2+
<system.webServer>
3+
4+
<!-- indicates that the server.js file is a node.js application
5+
to be handled by the iisnode module -->
6+
7+
<handlers>
8+
<add name="iisnode" path="server.js" verb="" modules="iisnode" />
9+
</handlers>
10+
11+
<rewrite>
12+
<rules>
13+
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
14+
<match url="(.*)" />
15+
<conditions>
16+
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
17+
</conditions>
18+
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
19+
</rule>
20+
<rule name="sendToNode">
21+
<match url="/*" />
22+
<conditions logicalGrouping="MatchAll">
23+
<add input="{REQUEST_URI}" negate="true" pattern="^/\.well-known\/" ignoreCase="true" />
24+
</conditions>
25+
<action type="Rewrite" url="server.js" />
26+
</rule>
27+
</rules>
28+
</rewrite>
29+
<iisnode devErrorsEnabled="false" />
30+
31+
<httpErrors existingResponse="PassThrough" />
32+
</system.webServer>
33+
</configuration>

0 commit comments

Comments
 (0)