24 lines
560 B
Nginx Configuration File
24 lines
560 B
Nginx Configuration File
server {
|
|
listen 0.0.0.0:80 default_server;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
|
|
|
|
# Fingerprinted build assets can be cached forever
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# SPA fallback: let React Router handle client-side routes
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|