LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule dir_module modules/mod_dir.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule setenvif_module modules/mod_setenvif.so
PidFile "/usr/local/apache2/logs/httpd.pid"
ErrorLog "/proc/self/fd/2"
CustomLog "/proc/self/fd/1" common
LogLevel info
Listen ${PORT}
ServerName localhost
DocumentRoot "/usr/local/apache2/htdocs"
DirectoryIndex index.html
User daemon
Group daemon
RewriteEngine On
RewriteRule ^/healthz$ /healthz.json [L]
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine On
# Allow direct access to index.html and existing files
RewriteRule ^index\.html$ - [L]
# If file exists, serve it
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
# If directory exists, serve it (DirectoryIndex will handle it)
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
# Otherwise, serve 200.html for SPA routing
RewriteRule . /200.html [L]
Header set Content-Type "application/json"
Header set Cache-Control "public, max-age=5"
Header set Service-Worker-Allowed "/"
# Cache static assets aggressively (they have hashed filenames)
Header set Cache-Control "public, max-age=31536000, immutable"
# Cache other static assets
Header set Cache-Control "public, max-age=31536000, immutable"
# Don't cache HTML files (they need to be fresh for updates)
Header set Cache-Control "no-cache, must-revalidate"
# Enable compression for text-based files
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|zip|gz|bz2|sit|rar|webp|avif)$ no-gzip dont-vary