Streamlit with Apache reverse proxy - "Please wait..."

Hi all,


Streamlit 1.4.0 deployed as a docker container, listening on port 8051, on an ec2 instance. Apache 2.4.18, on another node, is a reverse proxy to the streamlit app. Apache’s proxy, proxy_http and proxy_wstunnel modules are enabled.


  1. “Please wait…” - message on the browser when the proxy URL is hit. The app loads fine when it’s accessed directly via http://<ec2_host_fqdn>:8051 though.

  2. Firing the proxy URL ‘’ (internal domain), on chrome’s debug console:

    WebSocket connection to 'wss://' failed: WebSocket is closed before the connection is established.

    Uncaught Error: Unsupported state transition.
     at Po.stepFsm (main.cb6e038a.chunk.js:2:491430)
     at main.cb6e038a.chunk.js:2:494477

Apache vhost:

<VirtualHost *:443>

  ## Vhost docroot
  DocumentRoot "/var/www/html"

  ## Directories, there should at least be a declaration for /var/www/html

  <Directory "/var/www/html">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted

  ## Logging
  ErrorLog "/var/log/apache2/"
  ServerSignature Off
  CustomLog "/var/log/apache2/" combined 

  ## Proxy rules
  ProxyRequests Off
  ProxyPass /
  ProxyPassReverse /

   <Location "/stream">
      ProxyPass wss://
      ProxyPassReverse wss://

  ## SSL directives
  SSLEngine on
  SSLCertificateFile      "/etc/ssl/certs/ssl-cert-snakeoil.pem"
  SSLCertificateKeyFile   "/etc/ssl/private/ssl-cert-snakeoil.key"
  SSLCACertificatePath    "/etc/ssl/certs"
  SSLProxyEngine On

I referred quite a number of posts but I wasn’t able to find anything specific to Apache’s reverse proxy settings. Any help will be appreciated.



I am having a similar issue. I created a streamlit app and dockerized it. Now trying to reverse proxy my Apache server to connect to this docker container. But, the browser shows “Please Wait” and on inspecting the web page, the console shows the “Websocket connection failed”.
I am not well versed in how to upgrade the connection to websockets from my Apache SSL config.
Also, I am reverse proxying the docker IP to a subfolder rather than using the “/”. Like HTTP://my_server_name/my_awesome_app/

If you found a solution then please share.