# Apache — reverse proxy to the Node server.
#
#   sudo cp deploy/apache.conf /etc/apache2/sites-available/chordly.conf
#   sudo a2enmod proxy proxy_http headers
#   sudo a2ensite chordly
#   sudo systemctl reload apache2
#
# Point the DNS A record for cloudpal.live at this server first.

<VirtualHost *:80>
    ServerName cloudpal.live
    ServerAlias www.cloudpal.live

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyTimeout 600

    <Proxy http://127.0.0.1:3000>
        Require all granted
    </Proxy>

    # Stream downloads instead of buffering them.
    ProxyPass        / http://127.0.0.1:3000/ connectiontimeout=600 timeout=600
    ProxyPassReverse / http://127.0.0.1:3000/

    # The app only accepts small JSON bodies.
    LimitRequestBody 2097152
</VirtualHost>
