# Security Headers Configuration
# This file provides additional security headers for Apache servers
# Prevent clickjacking attacks
Header always set X-Frame-Options "DENY"
# Prevent MIME type sniffing
Header always set X-Content-Type-Options "nosniff"
# Enable XSS filtering
Header always set X-XSS-Protection "1; mode=block"
# Control referrer information
Header always set Referrer-Policy "strict-origin-when-cross-origin"
# Remove server information
Header always unset Server
Header always unset X-Powered-By
# Strict Transport Security (HSTS) - only enable in production with HTTPS
# Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Content Security Policy
Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com https://www.gstatic.com https://fonts.googleapis.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https: http://localhost:* ws://localhost:* wss://localhost:*; frame-src 'self' https://www.google.com; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests;"
# Permissions Policy
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), interest-cohort=()"
# Cache Control for sensitive files
Header always set Cache-Control "no-cache, no-store, must-revalidate"
Header always set Pragma "no-cache"
Header always set Expires "0"
# Cache Control for static assets
Header always set Cache-Control "public, max-age=31536000"
# Prevent access to sensitive files
Order allow,deny
Deny from all
# Prevent directory browsing
Options -Indexes
# Custom error pages
ErrorDocument 404 /index.html
ErrorDocument 500 /index.html