AWS Elastic Beanstalk:HTTP标题不会出现在Flask应用程序中 [英] AWS Elastic Beanstalk: HTTP Header not appearing in Flask application

查看:216
本文介绍了AWS Elastic Beanstalk:HTTP标题不会出现在Flask应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的Flask应用程序,我想在AWS Elastic Beanstalk上运行。

应用程序部署并运行良好,但是我注意到一个自定义的HTTP Header (HTTP_CUSTOM_TOKEN)不存在于 request.headers 中。



我假设我从Apache配置中丢失了一些东西,但是对这个环境不是很熟悉。

解决方案

你需要的是类似于@Fartash所建议的,只是略有不同。

添加 .ebextensions / python.config

  container_commands:
03wsgipass:
command:'echo'WSGIPassAuthorization On>> ../wsgi.conf'

使用AWS Elastic Beanstalk Python平台

I have a small Flask application that I want to run on AWS Elastic Beanstalk.

The application deploys and runs fine but I've noticed that a custom HTTP Header (HTTP_CUSTOM_TOKEN) is not present in request.headers.

I'm assuming I'm missing something from the Apache configuration but am not very familiar with that environment.

解决方案

What you need is something similar to what @Fartash suggested, just slightly different.

Add .ebextensions/python.config :

container_commands:
  03wsgipass:
    command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'

as explained at Using the AWS Elastic Beanstalk Python Platform

这篇关于AWS Elastic Beanstalk:HTTP标题不会出现在Flask应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆