ServerName streamlit.roman-halliday.com ServerAlias reporting.roman-halliday.com ServerAdmin david@roman-halliday.com ####################################################################### # No documents being served, only streamlit. # Don't configure for this VirtualHost ####################################################################### #DocumentRoot /var/www/streamlit ####################################################################### # Logging (use standard log files) ####################################################################### ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined ####################################################################### # Rewrite configuration ####################################################################### RewriteEngine on ####################################################################### # Reverse Proxy ####################################################################### RewriteCond %{HTTP:Upgrade} websocket RewriteRule /streamlit-app(.*) ws://streamlit.roman-halliday.com:8502/streamlit-app$1 [P,L] RewriteCond %{HTTP:Upgrade} !websocket RewriteRule /streamlit-app(.*) http://streamlit.roman-halliday.com:8502/streamlit-app$1 [P,L] ####################################################################### # Redirect if app path not given # So: https://streamlit.roman-halliday.com # Becomes: https://streamlit.roman-halliday.com/streamlit-app ####################################################################### RewriteCond %{REQUEST_URI} !streamlit-app RewriteRule ^/?$ /streamlit-app [L,R=302] ####################################################################### # Certificate - letsencrypt (auto configured by letsencrypt) ####################################################################### Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/reporting.roman-halliday.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/reporting.roman-halliday.com/privkey.pem