ideonate / streamlit-launchpad

Browse a folder containing multiple streamlit apps and launch them immediately
Apache License 2.0
141 stars 25 forks source link

Question on using NGINX as a reverse proxy #9

Closed arun-es closed 2 years ago

arun-es commented 2 years ago

I had configured NGINX as below:

location /streamlit/v1/stream {
        proxy_pass http://localhost:8501/stream;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
}

location /streamlit/v1/ {
        proxy_pass http://localhost:8501/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
}

location ^~ /streamlit/v1/media/ {
        proxy_pass http://localhost:8501/media/;
}

location ^~ /streamlit/static {
        proxy_pass http://localhost:8501/static/;
}
location ^~ /streamlit/v1/healthz {
    proxy_pass http://127.0.0.1:8501/healthz;
}
location ^~ /vendor {
    proxy_pass http://127.0.0.1:8501/vendor;
}

for the default streamlit app to work.

Are you aware if the rules would stay about the same, but I simply change 8501 to 8080 in your example?

danlester commented 2 years ago

I'm no NGINX expert, but I would say try what you suggest to see what happens! Sorry for the delay in picking this up anyway.