Clone04 commited on
Commit
085a006
·
verified ·
1 Parent(s): 3d44dfc

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +47 -3
nginx.conf CHANGED
@@ -1,14 +1,58 @@
1
  events {}
2
 
3
  http {
 
 
 
 
 
4
  server {
5
  listen 7860;
6
-
7
  server_name localhost;
8
 
 
 
9
  location / {
10
- root /usr/share/nginx/html;
11
  index index.html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
13
  }
14
- }
 
1
  events {}
2
 
3
  http {
4
+ include mime.types;
5
+ default_type application/octet-stream;
6
+
7
+ gzip off; # disable gzip if you're using Brotli-precompressed files
8
+
9
  server {
10
  listen 7860;
 
11
  server_name localhost;
12
 
13
+ root /usr/share/nginx/html;
14
+
15
  location / {
 
16
  index index.html;
17
+ try_files $uri $uri/ =404;
18
+ }
19
+
20
+ # Serve .br files
21
+ location ~* \.(br)$ {
22
+ add_header Content-Encoding br;
23
+ add_header Vary Accept-Encoding;
24
+ default_type application/octet-stream;
25
+ }
26
+
27
+ # Serve Brotli-compressed Unity files based on extension
28
+ location ~* \.wasm\.br$ {
29
+ add_header Content-Type application/wasm;
30
+ add_header Content-Encoding br;
31
+ add_header Vary Accept-Encoding;
32
+ }
33
+
34
+ location ~* \.js\.br$ {
35
+ add_header Content-Type application/javascript;
36
+ add_header Content-Encoding br;
37
+ add_header Vary Accept-Encoding;
38
+ }
39
+
40
+ location ~* \.data\.br$ {
41
+ add_header Content-Type application/octet-stream;
42
+ add_header Content-Encoding br;
43
+ add_header Vary Accept-Encoding;
44
+ }
45
+
46
+ location ~* \.unityweb\.br$ {
47
+ add_header Content-Type application/octet-stream;
48
+ add_header Content-Encoding br;
49
+ add_header Vary Accept-Encoding;
50
+ }
51
+
52
+ # Optional: set long cache headers for Unity build files
53
+ location ~* \.(js|data|wasm|unityweb)(\.br)?$ {
54
+ expires 1y;
55
+ access_log off;
56
  }
57
  }
58
+ }