]> Untitled Git - godot-builder.git/blob - nginx/conf.d/godot.conf
Squashed commit of the following:
[godot-builder.git] / nginx / conf.d / godot.conf
1 server {
2     listen  80;
3     root    /build;
4     index   index.html;
5
6     location / {
7         autoindex on;
8     }
9
10     location /hook/ {
11         proxy_pass http://hook;
12     }
13
14     #------------------------------------------------
15     # Adds required support for Godot 4 WebGL Support
16     #------------------------------------------------
17     location ~ .+/web/ {
18         add_header Cross-Origin-Resource-Policy same-origin;
19         add_header Cross-Origin-Opener-Policy same-origin;
20         add_header Cross-Origin-Embedder-Policy require-corp;
21     }
22
23     #----------------------------------
24     # Unity WebGL Support
25     #----------------------------------
26
27     # On-disk Brotli-precompressed data files should be served with compression enabled:
28     location ~ .+\.(data|symbols\.json)\.br$ {
29         # Because this file is already pre-compressed on disk, disable the on-demand compression on it.
30         # Otherwise nginx would attempt double compression.
31         gzip off;
32         add_header Content-Encoding br;
33         default_type application/octet-stream;
34     }
35
36     # On-disk Brotli-precompressed JavaScript code files:
37     location ~ .+\.js\.br$ {
38         gzip off; # Do not attempt dynamic gzip compression on an already compressed file
39         add_header Content-Encoding br;
40         default_type application/javascript;
41     }
42
43     # On-disk Brotli-precompressed WebAssembly files:
44     location ~ .+\.wasm\.br$ {
45         gzip off; # Do not attempt dynamic gzip compression on an already compressed file
46         add_header Content-Encoding br;
47         # Enable streaming WebAssembly compilation by specifying the correct MIME type for
48         # Wasm files.
49         default_type application/wasm;
50     }
51
52     # On-disk gzip-precompressed data files should be served with compression enabled:
53     location ~ .+\.(data|symbols\.json)\.gz$ {
54         gzip off; # Do not attempt dynamic gzip compression on an already compressed file
55         add_header Content-Encoding gzip;
56         default_type application/octet-stream;
57     }
58
59     # On-disk gzip-precompressed JavaScript code files:
60     location ~ .+\.js\.gz$ {
61         gzip off; # Do not attempt dynamic gzip compression on an already compressed file
62         add_header Content-Encoding gzip;
63         default_type application/javascript;
64     }
65
66     # On-disk gzip-precompressed WebAssembly files:
67     location ~ .+\.wasm\.gz$ {
68         gzip off; # Do not attempt dynamic gzip compression on an already compressed file
69         add_header Content-Encoding gzip;
70         # Enable streaming WebAssembly compilation by specifying the correct MIME type for
71         # Wasm files.
72         default_type application/wasm;
73     }
74 }