# cPanel/WHM only — Apache reverse proxy to the BCT app.
# Copy this file to BOTH of these paths (replace CPUSER with the cPanel account username):
#   /etc/apache2/conf.d/userdata/std/2_4/CPUSER/bandjouncommunitytexas.org/bct.conf
#   /etc/apache2/conf.d/userdata/ssl/2_4/CPUSER/bandjouncommunitytexas.org/bct.conf
# then run:  /scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
# Change 8085 if you changed the port in /opt/bct/settings.ini.

ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https" env=HTTPS
LimitRequestBody 314572800
ProxyTimeout 300

# photos and static files served directly by Apache
ProxyPass /.well-known !
ProxyPass /media/ !
ProxyPass /static/ !
Alias /media/ /opt/bct/uploads/
Alias /static/ /opt/bct/static/
<Directory /opt/bct/uploads>
    Require all granted
    Options -Indexes
</Directory>
<Directory /opt/bct/static>
    Require all granted
    Options -Indexes
</Directory>

ProxyPass        / http://127.0.0.1:8085/
ProxyPassReverse / http://127.0.0.1:8085/
