amazon-transcreation/apache/amazon-transcreation.conf
DJP 3fe93c2b22 feat: configure deployment for optical-dev.oliver.solutions/amazon-transcreation
- Apache reverse proxy config (replaces nginx — server already runs Apache)
- Next.js basePath set to /amazon-transcreation for subpath deployment
- Frontend on port 3050 (3000 taken), backend on 8040
- WebSocket URL auto-detects protocol from page location
- Deploy script handles Apache config injection into existing vhost
- All Docker ports bound to 127.0.0.1 (Apache handles external access)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 13:05:12 -04:00

44 lines
1.9 KiB
Text

# ============================================================
# Amazon Transcreation Platform — Apache Reverse Proxy
# ============================================================
# Add this inside your existing <VirtualHost *:443> block for
# optical-dev.oliver.solutions, or Include this file from it.
#
# Required Apache modules (enable if not already):
# sudo a2enmod proxy proxy_http proxy_wstunnel rewrite
# sudo systemctl restart apache2
# ============================================================
# --- API + Backend routes ---
ProxyPass /amazon-transcreation/api http://127.0.0.1:8040/api
ProxyPassReverse /amazon-transcreation/api http://127.0.0.1:8040/api
ProxyPass /amazon-transcreation/health http://127.0.0.1:8040/health
ProxyPassReverse /amazon-transcreation/health http://127.0.0.1:8040/health
ProxyPass /amazon-transcreation/docs http://127.0.0.1:8040/docs
ProxyPassReverse /amazon-transcreation/docs http://127.0.0.1:8040/docs
ProxyPass /amazon-transcreation/openapi.json http://127.0.0.1:8040/openapi.json
ProxyPassReverse /amazon-transcreation/openapi.json http://127.0.0.1:8040/openapi.json
# --- WebSocket (job monitoring) ---
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/amazon-transcreation/ws/(.*) ws://127.0.0.1:8040/ws/$1 [P,L]
ProxyPass /amazon-transcreation/ws http://127.0.0.1:8040/ws
ProxyPassReverse /amazon-transcreation/ws http://127.0.0.1:8040/ws
# --- Frontend (Next.js) ---
# Must come AFTER the more specific /api, /ws, /health rules
ProxyPass /amazon-transcreation http://127.0.0.1:3050/amazon-transcreation
ProxyPassReverse /amazon-transcreation http://127.0.0.1:3050/amazon-transcreation
# Increase timeouts for long-running agent API calls
ProxyTimeout 300
# Pass original host header
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"