:8080 {
    root * /app/dist
    encode gzip

    # SPA routing
    try_files {path} /index.html
    file_server

    # No-cache for index.html
    @indexhtml path /index.html
    header @indexhtml Cache-Control "no-cache, no-store, must-revalidate"
    header @indexhtml Pragma "no-cache"
    header @indexhtml Expires "0"

    # Long-term caching for static assets
    @staticassets path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot
    header @staticassets Cache-Control "public, max-age=31536000, immutable"

    # Security headers
    header * X-Frame-Options "SAMEORIGIN"
    header * X-Content-Type-Options "nosniff"
    header * X-XSS-Protection "1; mode=block"
}