dtaddis commited on
Commit
a0ffd25
·
1 Parent(s): de3bdc2

Handle compressed and uncompressed builds

Browse files
Files changed (2) hide show
  1. Nginx.conf +0 -22
  2. nginx_rename.conf +37 -0
Nginx.conf DELETED
@@ -1,22 +0,0 @@
1
- server {
2
- listen 7860;
3
- root /usr/share/nginx/html;
4
- index index.html;
5
-
6
- # Tell the browser to natively decompress Brotli files
7
- location ~ \.wasm\.br$ {
8
- gzip off;
9
- add_header Content-Encoding br;
10
- default_type application/wasm;
11
- }
12
- location ~ \.js\.br$ {
13
- gzip off;
14
- add_header Content-Encoding br;
15
- default_type application/javascript;
16
- }
17
- location ~ \.data\.br$ {
18
- gzip off;
19
- add_header Content-Encoding br;
20
- default_type application/octet-stream;
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
nginx_rename.conf ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 7860;
3
+ root /usr/share/nginx/html;
4
+ index index.html;
5
+
6
+ # --- 1. BROTLI COMPRESSED (.br) ---
7
+ # These match files ending in .br and tell the browser to decompress them
8
+ location ~ \.(wasm|js|data|unityweb)\.br$ {
9
+ gzip off; # Do not re-compress with gzip
10
+ add_header Content-Encoding br;
11
+
12
+ # Match the MIME type based on the extension BEFORE the .br
13
+ if ($request_filename ~* \.wasm\.br$) { set $m_type application/wasm; }
14
+ if ($request_filename ~* \.js\.br$) { set $m_type application/javascript; }
15
+ if ($request_filename ~* \.data\.br$) { set $m_type application/octet-stream; }
16
+ if ($request_filename ~* \.unityweb\.br$) { set $m_type application/octet-stream; }
17
+
18
+ default_type $m_type;
19
+ }
20
+
21
+ # --- 2. UNCOMPRESSED / STANDARD ---
22
+ # These match standard Unity files and ensure the browser understands the type
23
+ location ~ \.wasm$ {
24
+ default_type application/wasm;
25
+ }
26
+
27
+ location ~ \.js$ {
28
+ default_type application/javascript;
29
+ }
30
+
31
+ location ~ \.(data|unityweb)$ {
32
+ default_type application/octet-stream;
33
+ }
34
+
35
+ # Helper for general web files (CSS, Images)
36
+ include /etc/nginx/mime.types;
37
+ }