loreal-video-optimizer/deployment/apache-minimal.conf
2026-01-08 18:18:48 +05:30

49 lines
2 KiB
Text

# ==============================================================================
# MINIMAL APACHE CONFIGURATION (ProxyPass only)
# ==============================================================================
# Add these directives to your existing VirtualHost configuration
# Use this if you already have a VirtualHost for ai-sandbox.oliver.solutions
# ==============================================================================
# STEP 1: Enable required Apache modules (run once)
# sudo a2enmod proxy proxy_http headers
# STEP 2: Add these directives inside your existing <VirtualHost *:443> block
# ------------------------------------------------------------------------------
# Frontend - Serve Video Optimizer static files
# ------------------------------------------------------------------------------
Alias /video-optimizer /var/www/html/video-optimizer
<Directory /var/www/html/video-optimizer>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
# Cache static assets
<FilesMatch "\.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$">
Header set Cache-Control "public, max-age=31536000"
</FilesMatch>
# Don't cache HTML files
<FilesMatch "\.(html)$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
</FilesMatch>
</Directory>
# ------------------------------------------------------------------------------
# Backend API - Proxy to Flask backend
# ------------------------------------------------------------------------------
<Location /video-optimizer/api>
ProxyPass http://127.0.0.1:5000/api
ProxyPassReverse http://127.0.0.1:5000/api
ProxyTimeout 600
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
</Location>
# ------------------------------------------------------------------------------
# STEP 3: After adding these directives, test and reload Apache
# ------------------------------------------------------------------------------
# sudo apache2ctl configtest
# sudo systemctl reload apache2