File size: 1,612 Bytes
eb4616f
2d0dc1d
 
085a006
 
 
 
 
2d0dc1d
eb4616f
 
2d0dc1d
085a006
 
2d0dc1d
eb4616f
085a006
 
 
 
 
 
 
 
 
60ee378
085a006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d0dc1d
 
085a006
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
events {}

http {
    include       mime.types;
    default_type  application/octet-stream;

    gzip off; # disable gzip if you're using Brotli-precompressed files

    server {
        listen 7860;
        server_name localhost;

        root /usr/share/nginx/html;

        location / {
            index index.html;
            try_files $uri $uri/ =404;
        }

        # Serve .br files
        location ~* \.(br)$ {
            add_header Content-Encoding br;
            add_header Vary Accept-Encoding;
            default_type application/octet-stream;
        }
    
        # Serve Brotli-compressed Unity files based on extension
        location ~* \.wasm\.br$ {
            add_header Content-Type application/wasm;
            add_header Content-Encoding br;
            add_header Vary Accept-Encoding;
        }

        location ~* \.js\.br$ {
            add_header Content-Type application/javascript;
            add_header Content-Encoding br;
            add_header Vary Accept-Encoding;
        }

        location ~* \.data\.br$ {
            add_header Content-Type application/octet-stream;
            add_header Content-Encoding br;
            add_header Vary Accept-Encoding;
        }

        location ~* \.unityweb\.br$ {
            add_header Content-Type application/octet-stream;
            add_header Content-Encoding br;
            add_header Vary Accept-Encoding;
        }

        # Optional: set long cache headers for Unity build files
        location ~* \.(js|data|wasm|unityweb)(\.br)?$ {
            expires 1y;
            access_log off;
        }
    }
}