-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.config
More file actions
49 lines (45 loc) · 1.79 KB
/
web.config
File metadata and controls
49 lines (45 loc) · 1.79 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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<!-- Add WASM MIME type -->
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
<!-- Add JSON MIME type (if not already present) -->
<remove fileExtension=".json"/>
<mimeMap fileExtension=".json" mimeType="application/json" />
<!-- Add JavaScript MIME types -->
<remove fileExtension=".js"/>
<mimeMap fileExtension=".js" mimeType="application/javascript" />
<remove fileExtension=".mjs"/>
<mimeMap fileExtension=".mjs" mimeType="application/javascript" />
</staticContent>
<httpProtocol>
<customHeaders>
<!-- Enable Cross-Origin Isolation for WebGPU -->
<add name="Cross-Origin-Embedder-Policy" value="require-corp" />
<add name="Cross-Origin-Opener-Policy" value="same-origin" />
<!-- Enable CORS for wasm files -->
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
<!-- Enable compression for better performance -->
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<rewrite>
<rules>
<!-- Ensure service worker can be accessed -->
<rule name="Service Worker" stopProcessing="true">
<match url="^sw\.js$" />
<action type="Rewrite" url="sw.js" />
</rule>
</rules>
</rewrite>
<!-- Increase upload limit for large model files -->
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
</configuration>