简体   繁体   English

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

[英]Disallowed Host error when trying to deploy me serverless app with Zappa

I've followed the tutorial for deploying zappa step-by-step. 我已按照教程逐步部署zappa When it says to Add the returned URL to the ALLOWED_HOSTS I have done that (as well as add the development server): 当它说Add the returned URL to the ALLOWED_HOSTS我已经做到了(以及添加开发服务器):

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

However I still get this error: 但是我仍然收到此错误:

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.

Removing https:// and /dev is what solved the problem. 删除https:///dev解决问题。 So your ALLOWED_HOSTS should look like this: 因此,您的ALLOWED_HOSTS应该如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Zappa Deploy上出现NoSuchEntity错误 - Getting NoSuchEntity Error on Zappa Deploy 为什么 Serverless 在尝试打包或部署时会产生 Invalid Cross-device link 错误? - Why does Serverless produce an Invalid Cross-device link Error when trying to package or deploy? 尝试将Flask App部署到AWS Elastic Beanstalk时出错 - Error when Trying to Deploy Flask App to AWS Elastic Beanstalk 尝试将 Django 应用程序部署到 Heroku 时出错 - 依赖冲突 - Error when trying to deploy Django app to Heroku - Conflicting Dependencies 尝试使用 PythonAnyWhere 部署 Web Flask 应用程序时出现 WSGI 错误 - WSGI Error when Trying to Deploy Web Flask App with PythonAnyWhere 使用Zappa的Flask App部署中的错误 - Error in Flask App deployment using Zappa 部署的Zappa应用上的内部服务器错误 - Internal Server Error on deployed Zappa app 使用Zappa部署lambda时出错:调用UpdateFunctionCode操作时:解压后的大小必须小于262144000字节 - Error when using Zappa to deploy lambda: when calling the UpdateFunctionCode operation: Unzipped size must be smaller than 262144000 bytes 尝试从 VSCode 将带有 requirements.txt 的 flask 应用程序部署到 Azure Web 应用程序时缺少“gcc”错误 - Missing “gcc” error when trying to deploy a flask app with requirements.txt to Azure Web App from VSCode 尝试在 GoDaddy 上部署 Flask 应用程序时出现 403 - 403 when trying to deploy Flask app on GoDaddy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM