Port forwarding issues

Hi Streamlit community!

I’ve been working on a very simple app for a dissemination project and have run into issues getting it to work with port forwarding:

  • Using nginx as a reverse proxy backend opens Streamlit (e.g. passing traffic on port 80 to 8501), but never loads data. It keeps sending requests to the “stream” endpoint, but nothing comes through.

  • We have been able to get it to work on a different domain than the ec2 dns (http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/), but only using the same port that we run Streamlit server on.

  • We have tried playing with the configuration, including disabling CORS and running it headless with no luck.

Has anyone else run into this? Maybe I’m missing something obvious?

Thanks!
-Sassan

1 Like

Hey @sassan - welcome to Streamlit!

The /stream endpoint handles Streamlit’s websocket traffic. I believe nginx needs additional configuration to handle websocket data; it won’t just work out of the box.

There’s another thread over here where users have shared configs that work for them, including the bits that are required for websocket connections - this would be a good place to start!

1 Like