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).

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
답변함 한 달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠