-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweb.config
141 lines (138 loc) · 6.84 KB
/
web.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<!--
=========================================================================================
Copyright 2015 Community Information Online Consortium (CIOC) and KCL Software Solutions
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================================
-->
<configuration>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="false" allowHighBitCharacters="false">
<hiddenSegments>
<add segment="python" />
<add segment="docs" />
<add segment="text" />
<add segment="pagehelp" />
<add segment=".git" />
<add segment="includes" />
<add segment="aspnet_client" />
<add segment="obj" />
<add segment="Properties" />
<add segment=".gitignore" />
<add segment=".jshintrc" />
<add segment="pythonport.config" />
</hiddenSegments>
<fileExtensions>
<add fileExtension=".py" allowed="false" />
<add fileExtension=".suo" allowed="false" />
<add fileExtension=".sln" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
<rewrite>
<rules>
<clear />
<rule name="LetsEncrypt Rule" stopProcessing="true">
<match url="^\.well-known.*$" />
<action type="None" />
</rule>
<rule name="Redirect community-repo.cioc.ca to community-repository" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="community-repo.cioc.ca" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://community-repository.cioc.ca/{R:1}"
redirectType="Permanent" />
</rule>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="community-repository.cioc.ca" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}"
redirectType="Permanent" />
</rule>
<rule name="Set SSL X-Forwarded-Proto">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTPS}" pattern="on" />
</conditions>
<serverVariables>
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
<action type="Rewrite" url="{R:1}" />
</rule>
<rule name="Set HTTP X-Forwarded-Proto">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" />
</conditions>
<serverVariables>
<set name="HTTP_X_FORWARDED_PROTO" value="http" />
</serverVariables>
<action type="Rewrite" url="{R:1}" />
</rule>
<rule name="Pyramid Debug passthrough" stopProcessing="true">
<match url="^(/_debug_.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{SetPythonPort:9876}" pattern="(.*)" />
</conditions>
<action type="Rewrite" url="http://127.0.0.1:{C:1}/{R:1}" />
</rule>
<rule name="jQuery Versioned Files" stopProcessing="true">
<match url="^(scripts/jquery.*\.min\.js)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="None" />
</rule>
<rule name="Versioned Files" stopProcessing="true">
<match url="^(.*)_v[0-9]+(\.[a-zA-Z]{2,4})$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}{R:2}" appendQueryString="false" />
</rule>
<rule name="Media Files" stopProcessing="true">
<match url="^(.*\.)(css|js|gif|jpg|jpeg|png|html|xsd|txt)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}{R:2}" appendQueryString="false" />
</rule>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{SetPythonPort:9876}" pattern="(.*)" />
</conditions>
<action type="Rewrite" url="http://127.0.0.1:{C:1}/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
<match serverVariable="RESPONSE_Strict_Transport_Security"
pattern=".*" />
<conditions>
<add input="{HTTPS}" pattern="on" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="community-repository.cioc.ca" ignoreCase="true" />
</conditions>
<action type="Rewrite" value="max-age=31536000" />
</rule>
</outboundRules>
<rewriteMaps>
<rewriteMap name="SetPythonPort" defaultValue="9876">
</rewriteMap>
</rewriteMaps>
</rewrite>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=Edge,chrome=1" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>