I’m trying to deploy Django application with Bokeh visualisations on AWS Beanstalk.
Application works fine locally, but I’m unable to make it working on AWS. I’m using Beanstalk with single instance on Amazon Linux/2.8.3 and domain set with SSL redirection.
I think the issue is with Virtual Host settings. Below you may see the settings I use for SSL configuration.
<VirtualHost *:443> <Directory /opt/python/current/app/build/static> Order deny,allow Allow from all </Directory> SSLEngine on SSLCertificateFile "path to Certificate File" SSLCertificateKeyFile "path to Certificate Key File" SSLCipherSuite "Clipher string" SSLProtocol All -SSLv2 -SSLv3 SSLHonorCipherOrder On SSLSessionTickets Off Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" Header always set X-Frame-Options DENY Header always set X-Content-Type-Options nosniff ProxyPass / http://localhost:80/ retry=0 ProxyPassReverse / http://localhost:80/ ProxyPreserveHost on RequestHeader set X-Forwarded-Proto "https" early </VirtualHost>
I’ve tried to add to this script settings for Bokeh server proxy:
- ProxyPass /dashboard http://127.0.0.1:5100/dashboard/
- ProxyPassReverse /dashboard http://127.0.0.1:5100/dashboard/
I’ve also tried to create a separate virtual host for port 80
<VirtualHost *:80> ProxyPass /dashboard http://127.0.0.1:5100/dashboard/ ProxyPassReverse /dashboard http://127.0.0.1:5100/dashboard/ </VirtualHost>
When I run bokeh server on my EC2 instance with command
bokeh serve dashboard.py --port 5100 --use-xheaders --allow-websocket-origin="*"
it doesn’t work and I receive connection error.
Any suggestions on this would be much appreciated.