-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.config
More file actions
144 lines (133 loc) · 7.42 KB
/
web.config
File metadata and controls
144 lines (133 loc) · 7.42 KB
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
142
143
144
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Default Documents -->
<defaultDocument>
<files>
<clear />
<add value="landing.html" />
<add value="index.html" />
<add value="default.htm" />
</files>
</defaultDocument>
<!-- MIME Types for proper file serving -->
<staticContent>
<remove fileExtension=".html" />
<remove fileExtension=".css" />
<remove fileExtension=".js" />
<remove fileExtension=".json" />
<remove fileExtension=".png" />
<remove fileExtension=".jpg" />
<remove fileExtension=".jpeg" />
<remove fileExtension=".gif" />
<remove fileExtension=".svg" />
<remove fileExtension=".ico" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<remove fileExtension=".ttf" />
<remove fileExtension=".eot" />
<remove fileExtension=".webmanifest" />
<mimeMap fileExtension=".html" mimeType="text/html" />
<mimeMap fileExtension=".css" mimeType="text/css" />
<mimeMap fileExtension=".js" mimeType="application/javascript" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".png" mimeType="image/png" />
<mimeMap fileExtension=".jpg" mimeType="image/jpeg" />
<mimeMap fileExtension=".jpeg" mimeType="image/jpeg" />
<mimeMap fileExtension=".gif" mimeType="image/gif" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
<mimeMap fileExtension=".woff" mimeType="font/woff" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
<mimeMap fileExtension=".ttf" mimeType="font/ttf" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
</staticContent>
<!-- Security Headers -->
<httpProtocol>
<customHeaders>
<add name="X-Content-Type-Options" value="nosniff" />
<add name="X-Frame-Options" value="SAMEORIGIN" />
<add name="X-XSS-Protection" value="1; mode=block" />
<add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
<add name="Content-Security-Policy" value="default-src 'self' https:; script-src 'self' 'unsafe-inline' https://fonts.googleapis.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:;" />
</customHeaders>
</httpProtocol>
<!-- Compression -->
<httpCompression>
<dynamicTypes>
<clear />
<add enabled="true" mimeType="text/*" />
<add enabled="true" mimeType="message/*" />
<add enabled="true" mimeType="application/x-javascript" />
<add enabled="true" mimeType="application/javascript" />
<add enabled="true" mimeType="application/json" />
<add enabled="false" mimeType="*/*" />
</dynamicTypes>
<staticTypes>
<clear />
<add enabled="true" mimeType="text/*" />
<add enabled="true" mimeType="message/*" />
<add enabled="true" mimeType="application/javascript" />
<add enabled="true" mimeType="application/json" />
<add enabled="true" mimeType="image/svg+xml" />
<add enabled="false" mimeType="*/*" />
</staticTypes>
</httpCompression>
<!-- Caching -->
<caching>
<profiles>
<add extension=".html" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="7.00:00:00" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="7.00:00:00" />
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".jpeg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".svg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".ico" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".woff" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
<add extension=".woff2" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" duration="30.00:00:00" />
</profiles>
</caching>
<!-- URL Rewrite Rules -->
<rewrite>
<rules>
<!-- Landing page as default -->
<rule name="Root to Landing" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="/landing.html" />
</rule>
<!-- Direct access to landing page -->
<rule name="Landing Page Access" stopProcessing="true">
<match url="^landing\.html$" />
<action type="Rewrite" url="/landing.html" />
</rule>
<!-- Static assets (images, css, js, fonts) -->
<rule name="Static Assets" stopProcessing="true">
<match url="^(src/assets/|favicon|android-chrome|apple-touch-icon|.*\.(css|js|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot|webmanifest)).*$" />
<action type="Rewrite" url="/{R:0}" />
</rule>
<!-- React app routes - catch all remaining routes -->
<rule name="React Router Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/api/" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
<!-- Error Pages -->
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" />
<error statusCode="404" path="/landing.html" responseMode="ExecuteURL" />
</httpErrors>
<!-- Remove Server Header -->
<security>
<requestFiltering removeServerHeader="true" />
</security>
</system.webServer>
</configuration>