Thanks for the information here @virusvn.
This just about works for me except that: if I want the app to be hosted at /myapp, I find that streamlit looks for /myapp/stream and /myapp/healthz, but looks for static items at an absolute /static URL.
This is probably by design but it could easily conflict with /static based on the main site.
The sample nginx configuration given above implies that you are seeing something different - stream accessed at /stream instead of  /streamlit-components-demo/stream (although my nginx knowledge is limited), so maybe I’m missing some other configuration you’ve already set.
Is there a configuration option in streamlit asking for static assets to be fetched from a relative URL, i.e. /myapp/static in my case?