sheer / nginx.conf
barreloflube's picture
chore: Optimize Dockerfile and add Nginx configuration for production deployment
8502b63
raw
history blame
829 Bytes
server {
listen 7860;
listen [::]:7860;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
}
# Handle SPA routing - redirect all requests to index.html
location / {
try_files $uri $uri/ /index.html;
}
# Don't cache index.html
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
expires 0;
}
# Handle 404 errors
error_page 404 /index.html;
}