28 lines
773 B
Nginx Configuration File
28 lines
773 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html /viewer/index.html;
|
|
|
|
# Enable gzip compression for CAD models, netlists & JSON catalogs
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /viewer/index.html;
|
|
}
|
|
|
|
# Cache static CAD assets and JSON catalogs
|
|
location ~* \.(json|dxf|scad|csv|stl|obj)$ {
|
|
expires 1d;
|
|
add_header Cache-Control "public, no-transform";
|
|
add_header Access-Control-Allow-Origin "*";
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|