can
July 18, 2023, 7:49am
1
Hello everyone,
I am using caddy as a reverse proxy. I deployed an streamlit app and configured Caddyfile to use as a reverse proxy for streamlit application URL (http://ip-address:8501 ). It is working perfectly, but I also need to deploy second streamlit app and access it on (http://example.com/secondapp ). I configured my Caddyfile like that:
42.252.231.56 {
reverse_proxy http://42.252.231.56:8501
#root * /var/www
file_server
}
42.252.231.56/secondapp {
reverse_proxy http://42.252.231.56:8502
file_server
}
How can I solve this?
Hi @can ,
I’m not familiar with Caddy, but skimming through their docs , you may want to use paths instead of URLs for the different applications.
Would you mind trying this and see if it solves the issue?
42.252.231.56 {
route {
reverse_proxy /secondapp/* http://42.252.231.56:8502
reverse_proxy http://42.252.231.56:8501
}
}
Thanks,
Charly
can
July 18, 2023, 7:59am
3
Hi Charly,
Thanks for your quick reply. I tried it but it is not working. I got this message always…
Ok, thanks for your feedback!
Note that Streamlit, by default, doesn’t support running in a subdirectory as it expects apps to be deployed at the root of a domain.
Would you be able to run your Streamlit apps on their own subdomain rather than a subdirectory?
If not, I may pass your issue to the devs as they may be able to find a workaround for your issue.
Thanks,
Charly
can
July 18, 2023, 8:33am
5
I need to use in subdir. I appreciate it if you pass that to your dev team,
Thank you so much.
1 Like
Sure! I’ve passed it to the Devs.
Thanks for your patience
Charly
1 Like
can
July 18, 2023, 12:47pm
7
Hi again Charly,
I solved the issue, I just start second streamlit app by server.baseUrlPath
option. I defined the path which I defined in my Caddyfile and it worked!
1 Like
Oh, good to hear you managed to sort it!
Happy streamlitin’!
Charly
1 Like