Thank you @pybokeh for your help. I came across this useful page and it shows how to get the current configuration using streamlit config show and how to set it.
https://streamlit.io/docs/cli.html?highlight=streamlit%20config%20show#view-all-config-options 200
According to the latest changelog 43, we have this option now:


 Use  server.baseUrlPath  config option to set Streamlit’s URL to something like  http://domain.com/customPath .

Thanks for your support!