尝试使用Zappa部署无服务器应用程序时出现“禁止主机”错误

时间:2018-06-17 01:19:25

标签: python amazon-web-services aws-lambda

我已逐步跟踪the tutorial for deploying zappa。当它告诉Add the returned URL to the ALLOWED_HOSTS我已经这样做了(以及添加开发服务器):

ALLOWED_HOSTS = ['127.0.0.1', 'https://*******.execute-api.us-east-2.amazonaws.com/dev']

但是我仍然会收到此错误:

Invalid HTTP_HOST header: '********.execute-api.us-east-2.amazonaws.com'. 
You may need to add '********.execute-api.us-east-2.amazonaws.com' to ALLOWED_HOSTS.

1 个答案:

答案 0 :(得分:0)

删除https:///dev是解决问题的方法。所以你的ALLOWED_HOSTS应该是这样的:

ALLOWED_HOSTS = ['127.0.0.1', '*******.execute-api.us-east-2.amazonaws.com']