Spaces:
No application file
No application file
File size: 831 Bytes
221c571 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
server {
listen 80;
server_name localhost;
# Set the root directory for serving files
root /usr/share/nginx/html;
# Specify the default file to serve
index index.html;
# Set default character set
charset utf-8;
# Configure routing for the Single Page Application (SPA)
location / {
# Try to serve the requested file directly, then as a directory,
# and finally, fall back to index.html to let the client-side router handle it.
try_files $uri $uri/ /index.html;
}
# Optional: Configure browser caching for static assets to improve performance.
# This tells browsers they can cache these file types for one year.
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public";
}
}
|