Serve Streamlit app via SSL

0

I have a Streamlit app running on an EC2 instance on port 8501 (default for Streamlit).

I now need to serve this app on a sub-domain (ex: https://mysubdomain.xyz.com). I have purchased my domain on Route 53 with an SSL certificate which I have received from ACM (AWS Certificate Manager).

Any suggestions on how I can achieve this with minimal additional technologies? Also, if possible I'd like to avoid using an application load balancer.

On the other hand, I can (if necessary) use Cloudfront (because it's free for my minimal usage).

vikram
已提問 1 個月前檢視次數 199 次
1 個回答
1

Create a CloudFront distribution whose custom source is the EC2 instance https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html#concept_CustomOrigin

Associate the ACM cert with the CloudFront distribution https://repost.aws/knowledge-center/install-ssl-cloudfront

You mention a Route 53 subdomain, if that's something you choose to do then this will help https://repost.aws/knowledge-center/create-subdomain-route-53

profile picture
專家
Steve_M
已回答 1 個月前
  • Thank you for your response.

    I followed the article's steps for Cloudfront (not yet gotten to ACM cert) and I'm getting the following error: """ 504 ERROR The request could not be satisfied. CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Generated by cloudfront (CloudFront) Request ID: Tlx3w7yS_9o5xPxGDSRCA9aUt7p5DXNh3fNvxYqsKLk5ddyLhkm6Eg== """

    Any thoughts on how to trouble shoot?

    My app is up and running and is accessible via the public Internet on port 8051. I've set up the necessary inbound security group rule on EC2 for this purpose.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南