Best webserver to use with Streamlit

Hello everyone!

I just started to use Streamlit and I want to use streamlit with a webserver(such as nginx, apache or whatever you suggest).

For now, I just tried to use with NGINX but it is not working on nginx. If you help me to solve NGINX issue, it would be great. Or I am open to all other webserver suggestions.

1 Like

Hello, Franky1

I already see that thread and tried.

Here is my config.toml file:

# port=80 # change port number. By default streamlit uses 8501 port
headless=true # This will eliminate automatically open browser

And, here is my nginx.conf

    server {
       listen 80;
       index index.php index.html index.htm;
       location /demo {
          proxy_set_header   Host $host;
          proxy_set_header   X-Real-IP $remote_addr;
          proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header   X-Forwarded-Proto $scheme;
          proxy_buffering    off;
          proxy_http_version 1.1;
          # Also requires websocket:
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
          proxy_read_timeout 86400;
       error_page 404 /404.html;
       error_page 500 502 503 504 /50x.html;
       location = /50x.html {
          root /usr/share/nginx/html;

When I visit https:ip-adress/demo, this page opens.

I couldnโ€™t solve this issue, do you have any idea?

Here is nginx latest logs

2023/05/30 13:58:21 [error] 18787#18787: *1 open() "/usr/share/nginx/html/common/css/styles.css" failed (2: No such file or directory), client:, server:, request: "GET /common/css/styles.css HTTP/1.1", host: "", referrer: ""

Iโ€™m not sure, but from the error in this log I understand that NGINX is trying to access the streamlit files from /usr/share/nginx/html/ directory and thatโ€™s why Iโ€™m getting the error. but I have no idea how to fix it. Can you help me?