-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebgl_nginx.conf
91 lines (76 loc) · 3.38 KB
/
webgl_nginx.conf
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
events { worker_connections 1024; }
http {
server {
include mime.types;
listen 80;
# location / {
# #Reverse proxy does not work here, because API is not in docker
# proxy_pass http://localhost:8080;
# }
gzip on;
gzip_comp_level 3;
gzip_types text/css text/javascript image/png image/webp image/x-jng image/gif image/jpeg;
location ^~ /public {
root /usr/local/nginx;
add_header Cach-Control public;
add_header Pragma public;
add_header Vary Accept-Encoding;
add_header Access-Control-Allow-Origin *;
expires 1M;
autoindex on;
autoindex_format json;
try_files $uri $uri/ =404;
}
location = /panel {
proxy_set_header Host $host;
proxy_pass http://altzone_panel_dev:8081/panel/;
}
location ^~ /game {
root /usr/local/nginx;
index index.html;
try_files $uri $uri/ =404;
}
# On-disk Brotli-precompressed data files should be served with compression enabled:
location ~ .+\.(data|symbols\.json)\.br$ {
# Because this file is already pre-compressed on disk, disable the on-demand compression on it.
# Otherwise nginx would attempt double compression.
gzip off;
add_header Content-Encoding br;
default_type application/octet-stream;
}
# On-disk Brotli-precompressed JavaScript code files:
location ~ .+\.js\.br$ {
gzip off; # Do not attempt dynamic gzip compression on an already compressed file
add_header Content-Encoding br;
default_type application/javascript;
}
# On-disk Brotli-precompressed WebAssembly files:
location ~ .+\.wasm\.br$ {
gzip off; # Do not attempt dynamic gzip compression on an already compressed file
add_header Content-Encoding br;
# Enable streaming WebAssembly compilation by specifying the correct MIME type for
# Wasm files.
default_type application/wasm;
}
# On-disk gzip-precompressed data files should be served with compression enabled:
location ~ .+\.(data|symbols\.json)\.gz$ {
gzip off; # Do not attempt dynamic gzip compression on an already compressed file
add_header Content-Encoding gzip;
default_type application/gzip;
}
# On-disk gzip-precompressed JavaScript code files:
location ~ .+\.js\.gz$ {
gzip off; # Do not attempt dynamic gzip compression on an already compressed file
add_header Content-Encoding gzip; # The correct MIME type here would be application/octet-stream, but due to Safari bug https://bugs.webkit.org/show_bug.cgi?id=247421, it's preferable to use MIME Type application/gzip instead.
default_type application/javascript;
}
# On-disk gzip-precompressed WebAssembly files:
location ~ .+\.wasm\.gz$ {
gzip off; # Do not attempt dynamic gzip compression on an already compressed file
add_header Content-Encoding gzip;
# Enable streaming WebAssembly compilation by specifying the correct MIME type for
# Wasm files.
default_type application/wasm;
}
}
}