29 lines
877 B
Plaintext
29 lines
877 B
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
# Serve static files
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
|
add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
|
}
|
|
|
|
# Explicitly handle asset files
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
|
root /usr/share/nginx/html;
|
|
expires 30d;
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
add_header Access-Control-Allow-Origin *;
|
|
}
|
|
|
|
# Error pages
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|