Here is my current app.conf that is being used to configure nginx
server {

	listen 80;
	server_name example.com;

	location / {
		return 301 https://$host$request_uri;
	}

	location /.well-known/acme-challenge/ {
		root /var/www/certbot;
	}

}
# I use upstream but its not needed.
# If you want to use it you can just change 
# "upstream {name_of_streamlit_container}"
upstream streamlit_app {
    server streamlit_app:8501;
}

server {

	listen 443 ssl;
	server_name example.com;

	ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
	include /etc/letsencrypt/options-ssl-nginx.conf;
	ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

	# streamlit config
	location / {
		proxy_pass http://streamlit_app/;
	}

	location ^~ /static {
		proxy_pass http://streamlit_app/static/;
	}

	location ^~ /healthz {
		proxy_pass http://streamlit_app/healthz;
	}

	location ^~ /vendor {
		proxy_pass http://streamlit_app/vendor;
	}

	location /stream {
		proxy_pass http://streamlit_app/stream;
		proxy_http_version 1.1;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $host;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_read_timeout 86400;
	}

}