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 # HTTP (port 80) only exists to push to HTTPS # So ignore ofiginal configuration for serving streamlit ####################################################################### #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] ####################################################################### # Push all requests for http to https and forward to /streamlit-app # (originaly auto configured by letsencrypt, RewriteRule modified) ####################################################################### RewriteCond %{SERVER_NAME} =streamlit.roman-halliday.com [OR] RewriteCond %{SERVER_NAME} =reporting.roman-halliday.com RewriteRule ^ https://%{SERVER_NAME}/streamlit-app [END,NE,R=permanent]