交互我有一个瓶的应用程序看起来像这样:部署瓶应用通过弹性魔豆与S3
from flask import Flask
import boto3
application = Flask(__name__)
@application.route("/")
def home():
return "Server successfully loaded"
@application.route("/app")
def frontend_from_aws():
s3 = boto3.resource("s3")
frontend = s3.Object(bucket_name = "my_bucket", key = "frontend.html")
return frontend.get()["Body"].read()
if __name__ == "__main__":
application.debug = True
application.run()
一切完美的作品时,我在本地测试,但是当我的应用程序部署到弹性魔豆第二端点给出了一个内部服务器错误:
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
我没看到什么惊人的记录,虽然我不能完全肯定我会知道去哪里找。有任何想法吗?
更新:作为一个测试,我frontend.html移动到不同的水桶,并相应修改了“/应用”端点,而神秘它能正常工作。显然这与原始存储桶的设置有关。有人知道正确的设置可能是什么吗?
大约一年前,我创建了我的Elastic Beanstalk实例和另一个S3存储桶(应用程序在其上工作),但我不记得我做了什么配置。你有没有参考资料可以解释需要做什么? –