video-accessibility/deploy/apache-video-accessibility.conf
Vadym Samoilenko 4edd4da0b2 fix(deploy): optical-dev deploy script and Apache config ready for production
deploy-dev.sh:
- BUILD_SERVICES now includes tts-worker, ffmpeg-worker, whisper-worker (enabled
  in docker-compose.optical-dev.yml via USE_CELERY_FALLBACK=true)
- ensure_apache_modules(): enables proxy, proxy_http, proxy_wstunnel, rewrite
- Apache fragment: WS proxy (ws://) placed BEFORE HTTP /api/ proxy (required
  for correct longest-match precedence in Apache)
- Added ProxyTimeout 600 (10 min) and LimitRequestBody 2147483648 (2 GB) for
  large video uploads; disablereuse=on for WS pool correctness
- Fragment always regenerated on deploy (picks up PORT/WEBROOT changes)
- Logs command uses full $COMPOSE variable instead of hardcoded partial flags

deploy/apache-video-accessibility.conf:
- Static reference copy of the Apache fragment with inline comments explaining
  each directive

.env.production:
- Updated remaining ai-sandbox.oliver.solutions URLs to optical-dev.oliver.solutions
  (API_BASE_URL, COOKIE_DOMAIN, CLIENT_BASE_URL, AZURE_REDIRECT_URI, CORS_ORIGINS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:24:40 +01:00

58 lines
2.6 KiB
Text

# =============================================================
# video-accessibility — Apache config fragment
# optical-dev.oliver.solutions
#
# This file is auto-overwritten by scripts/deploy-dev.sh on
# every deploy (to pick up PORT / WEBROOT changes).
# Do NOT add custom edits here — put them in deploy-dev.sh.
#
# Required modules:
# sudo a2enmod proxy proxy_http proxy_wstunnel rewrite headers
#
# Include injected into vhost by deploy-dev.sh:
# /etc/apache2/sites-available/optical-dev.oliver.solutions.conf
# =============================================================
# ── Timeouts for large video uploads (up to 2 GB, ~10 min) ──
<IfModule mod_proxy.c>
ProxyTimeout 600
</IfModule>
# ── WebSocket proxy (MUST be before /api/ HTTP proxy) ────────
# mod_proxy_wstunnel handles the Upgrade: websocket header.
# disablereuse=on keeps long-lived WS connections from blocking pool.
ProxyPass /video-accessibility/api/v1/ws/ ws://127.0.0.1:8012/api/v1/ws/ disablereuse=on
ProxyPassReverse /video-accessibility/api/v1/ws/ ws://127.0.0.1:8012/api/v1/ws/
# ── API proxy ─────────────────────────────────────────────────
# Strips /video-accessibility prefix so FastAPI sees /api/v1/...
ProxyPass /video-accessibility/api/ http://127.0.0.1:8012/api/
ProxyPassReverse /video-accessibility/api/ http://127.0.0.1:8012/api/
# Swagger / OpenAPI
ProxyPass /video-accessibility/docs http://127.0.0.1:8012/docs
ProxyPassReverse /video-accessibility/docs http://127.0.0.1:8012/docs
ProxyPass /video-accessibility/openapi.json http://127.0.0.1:8012/openapi.json
ProxyPassReverse /video-accessibility/openapi.json http://127.0.0.1:8012/openapi.json
# ── SPA static files ─────────────────────────────────────────
Alias /video-accessibility /var/www/html/video-accessibility
<Directory /var/www/html/video-accessibility>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
# Allow large video file uploads through Apache body limit (2 GB)
LimitRequestBody 2147483648
RewriteEngine On
RewriteBase /video-accessibility/
# Serve real files/directories directly (JS, CSS, assets)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# All other paths → index.html (React Router handles client-side nav)
RewriteRule ^ index.html [L]
</Directory>