Streamlit app
I have a streamlit app running on port 8501:
https://dharmatech.dev:8501/fed-net-liquidity/
Here's how I'm starting the app:
streamlit run \
--browser.serverAddress dharmatech.dev \
--browser.serverPort 8501 \
--server.sslCertFile /home/dharmatech/fullchain.pem \
--server.sslKeyFile /home/dharmatech/privkey.pem \
--server.baseUrlPath fed-net-liquidity \
Fed_Net_Liquidity.py
Apache configuration
Here's the contents of /etc/apache2/sites-available/dharmatech.dev-le-ssl.conf
:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName dharmatech.dev
ServerAlias www.dharmatech.dev
DocumentRoot /var/www/dharmatech.dev
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/dharmatech.dev/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dharmatech.dev/privkey.pem
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /fed-net-liquidity/(.*) wss://dharmatech.dev:8501/fed-net-liquidity/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /fed-net-liquidity/(.*) https://dharmatech.dev:8501/fed-net-liquidity/$1 [P,L]
SSLProxyEngine on
#ProxyPass /fed-net-liquidity https://dharmatech.dev:8501/fed-net-liquidity
ProxyPassReverse /fed-net-liquidity https://dharmatech.dev:8501/fed-net-liquidity
#ProxyPass /fed-net-liquidity wss://dharmatech.dev:8501/fed-net-liquidity
ProxyPassReverse /fed-net-liquidity wss://dharmatech.dev:8501/fed-net-liquidity
</VirtualHost>
</IfModule>
Results
When I go to:
https://dharmatech.dev/fed-net-liquidity/
here's the result:
Question
What's a good way to set up the proxy so that
https://dharmatech.dev/fed-net-liquidity/
results in the app being properly rendered?
apache2ctl -S
output:
$ sudo apache2ctl -S
VirtualHost configuration:
*:443 dharmatech.dev (/etc/apache2/sites-enabled/dharmatech.dev-le-ssl.conf:2)
*:80 dharmatech.dev (/etc/apache2/sites-enabled/dharmatech.dev.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
streamlit
server with a base URL withconfig.toml
: docs.streamlit.io/develop/api-reference/configuration/…