52 lines
1.0 KiB
Nginx Configuration File
52 lines
1.0 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
server_tokens off;
|
|
access_log off;
|
|
|
|
# Enable SharedArrayBuffer so ONNX Runtime can use multithreaded WASM when
|
|
# WebGPU is unavailable or falls back to CPU execution.
|
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
|
|
|
gzip on;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 1024;
|
|
gzip_types
|
|
text/plain
|
|
text/css
|
|
text/xml
|
|
text/javascript
|
|
application/javascript
|
|
application/json
|
|
application/xml
|
|
image/svg+xml
|
|
font/woff2;
|
|
|
|
location /assets/ {
|
|
try_files $uri =404;
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
location = /favicon.svg {
|
|
try_files $uri =404;
|
|
expires 30d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
location = /config.js {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
expires -1;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|