veza/config/incus/apache/veza-web.conf

62 lines
2.3 KiB
Text

<VirtualHost *:80>
ServerName veza-web
DocumentRoot /var/www/veza
# Logging
ErrorLog ${APACHE_LOG_DIR}/veza-web-error.log
CustomLog ${APACHE_LOG_DIR}/veza-web-access.log combined
# Security headers
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
# Gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>
# Serve static files
<Directory /var/www/veza>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
# React Router - serve index.html for all routes
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
# Cache static assets
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/eot "access plus 1 year"
</IfModule>
# API proxy (optional - can be handled by HAProxy)
# ProxyPass /api/ http://10.10.10.2:8080/api/
# ProxyPassReverse /api/ http://10.10.10.2:8080/api/
# WebSocket proxy for chat (optional - can be handled by HAProxy)
# ProxyPass /ws/ ws://10.10.10.3:8081/ws/
# ProxyPassReverse /ws/ ws://10.10.10.3:8081/ws/
# WebSocket proxy for stream (optional - can be handled by HAProxy)
# ProxyPass /stream/ ws://10.10.10.4:3002/stream/
# ProxyPassReverse /stream/ ws://10.10.10.4:3002/stream/
</VirtualHost>