AWS Elastic Beanstalk: HTTP Header not appearing in Flask application

◇◆丶佛笑我妖孽 提交于 2019-12-05 11:26:37

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

Rishabh Jhalani

Remove underscores from the header variables, example:-

header_var_val = "some value"
replace it with -- headervarval = "some value"

You need to enable the WSGIPassAuthorization. If you do not specifically enable auth forwarding, apache will consume the required headers and your app won't receive it.

Add this to your *.config file in .ebextensions folder.

commands: WSGIPassAuthorization: command: sed -i.bak '/WSGIScriptAlias/ a WSGIPassAuthorization On' config.py cwd: /opt/elasticbeanstalk/hooks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!