<VirtualHost *:80>
    ServerAdmin admin@undateable.me
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # API proxy to microservices (if running locally)
    # In production, ALB handles this routing
    <IfModule proxy_module>
        ProxyPreserveHost On

        # Auth service
        ProxyPass /api/auth http://auth-service:8001/api/auth
        ProxyPassReverse /api/auth http://auth-service:8001/api/auth

        # Profiles service
        ProxyPass /api/profiles http://profiles-service:8002/api/profiles
        ProxyPassReverse /api/profiles http://profiles-service:8002/api/profiles
        ProxyPass /api/criminal_check http://profiles-service:8002/api/criminal_check
        ProxyPassReverse /api/criminal_check http://profiles-service:8002/api/criminal_check

        # Messaging service
        ProxyPass /api/conversations http://messaging-service:8003/api/conversations
        ProxyPassReverse /api/conversations http://messaging-service:8003/api/conversations
        ProxyPass /api/messages http://messaging-service:8003/api/messages
        ProxyPassReverse /api/messages http://messaging-service:8003/api/messages

        # Burn service
        ProxyPass /burn-api http://burn-service:8004/burn-api
        ProxyPassReverse /burn-api http://burn-service:8004/burn-api

        # WebSocket service
        ProxyPass /ws ws://websocket-service:8005/ws
        ProxyPassReverse /ws ws://websocket-service:8005/ws
    </IfModule>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
