Spaces:
Running
Running
| server { | |
| listen 7860; | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| # --- 1. BROTLI COMPRESSED (.br) --- | |
| # These match files ending in .br and tell the browser to decompress them | |
| location ~ \.(wasm|js|data|unityweb)\.br$ { | |
| gzip off; # Do not re-compress with gzip | |
| add_header Content-Encoding br; | |
| # Match the MIME type based on the extension BEFORE the .br | |
| if ($request_filename ~* \.wasm\.br$) { set $m_type application/wasm; } | |
| if ($request_filename ~* \.js\.br$) { set $m_type application/javascript; } | |
| if ($request_filename ~* \.data\.br$) { set $m_type application/octet-stream; } | |
| if ($request_filename ~* \.unityweb\.br$) { set $m_type application/octet-stream; } | |
| default_type $m_type; | |
| } | |
| # --- 2. UNCOMPRESSED / STANDARD --- | |
| # These match standard Unity files and ensure the browser understands the type | |
| location ~ \.wasm$ { | |
| default_type application/wasm; | |
| } | |
| location ~ \.js$ { | |
| default_type application/javascript; | |
| } | |
| location ~ \.(data|unityweb)$ { | |
| default_type application/octet-stream; | |
| } | |
| # Helper for general web files (CSS, Images) | |
| include /etc/nginx/mime.types; | |
| } | |