CORS errors for js files then using Apache reverse PROXY

Here is a modified virtual host file that works. Had to fix a few things from this solution: Authentication for an app behind reverse proxy

No need for export BOKEH_RESOURCES=cdn;
I was missing the mapping for the local static directory.

<VirtualHost *:443>
    ServerName my_host.com

    ProxyPass /daily_account_pnl_pos/ws ws://127.0.0.1:5006/daily_account_pnl_pos/ws
    ProxyPassReverse /daily_account_pnl_pos/ws ws://127.0.0.1:5006/daily_account_pnl_pos/ws

    ProxyPass /daily_account_pnl_pos/static http://127.0.0.1:5006/static
    ProxyPassReverse /daily_account_pnl_pos/static http://127.0.0.1:5006/static

    ProxyPassMatch /daily_account_pnl_pos/(.*)$ http://127.0.0.1:5006/daily_account_pnl_pos/$1
    ProxyPassReverse /daily_account_pnl_pos/(.*)$ http://127.0.0.1:5006/daily_account_pnl_pos/$1

    Redirect /daily_account_pnl_pos /daily_account_pnl_pos/

    Alias /static /home/me/mambaforge/lib/python3.10/site-packages/bokeh/server/static
    <Directory "/home/me/mambaforge/lib/python3.10/site-packages/bokeh/server/static">
    Require all granted
    Options +Indexes
    </Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/my_host.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my_host.com/privkey.pem
</VirtualHost>
2 Likes