Skip to content

Instantly share code, notes, and snippets.

@r1noff
Last active April 20, 2021 03:00
Show Gist options
  • Save r1noff/44ca2efa016d77201a0857db92d24e2d to your computer and use it in GitHub Desktop.
Save r1noff/44ca2efa016d77201a0857db92d24e2d to your computer and use it in GitHub Desktop.
# Nginx server configuration for host Unity WebGL application
# With WebAssemblyStreaming
# Works perfectly on Unity 2020.3
server {
root ***YOUR SERVER ROOT FOLDER***
index index.html index.htm index.nginx-debian.html;
server_name **YOUR SERVER NAME***
autoindex on;
autoindex_localtime on;
location / {
try_files $uri $uri/ =404;
}
location ~* ^.*\.(js)$ {
types {}
default_type application/javascript;
}
location ~* ^.*\.(wasm)$ {
types {}
default_type application/wasm;
}
location ~* ^.*\.(wasm.gz)$ {
gunzip on;
gzip off;
types {}
default_type application/wasm;
add_header Content-Encoding gzip;
}
location ~* ^.*\.(framework.js.gz|js.gz)$ {
gunzip on;
gzip off;
types {}
default_type application/javascript;
add_header Content-Encoding gzip;
}
location ~* ^.*\.(data.gz|symbols.json.gz)$ {
gunzip on;
gzip off;
types {}
default_type application/octet-stream;
add_header Content-Encoding gzip;
}
location ~* ^.*\.(wasm.br)$ {
types {}
default_type application/wasm;
add_header Content-Encoding br;
}
location ~* ^.*\.(framework.js.br|js.br)$ {
types {}
default_type application/javascript;
add_header Content-Encoding br;
}
location ~* ^.*\.(data.br|symbols.json.br)$ {
types {}
default_type application/octet-stream;
add_header Content-Encoding br;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment