How to run Streamlit app within Flask with HTTPS using Nginx?

I’m working on a project where I have a Flask web app running as a web service. I want to add a feature that allows users to upload their Streamlit apps (Python scripts) and run them within my Flask app. However, I’ve run into an issue: the Streamlit apps are hosted on HTTP, not HTTPS, which is a security concern.

Here’s my plan:

  1. Users upload a script.
  2. My Flask app allocates a part of its functionality to run the Streamlit app.
  3. The Streamlit app currently runs over HTTP, but I want it to run over HTTPS.

I’ve heard that Nginx can help with enabling HTTPS and that I can use an iframe to embed the Streamlit app back into my Flask app.

My questions:

  1. How can I configure Nginx to make the embedded Streamlit app use HTTPS?
  2. Are there any security concerns or best practices I should be aware of when doing this?
  3. Do you have any suggestions for alternative approaches or tools that might simplify this process?

Any advice or guidance on this issue would be greatly appreciated. Thanks in advance for your help!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.