我正在使用 AWS elastic beanstalk 来提供自定义 python 应用程序。除了更新环境变量外,一切正常。如果我尝试更改eb setenv FOO=bar (或在控制台中更改),应用程序将停止识别所有env 变量。重新启动服务器或发送新的部署解决了问题,但客户端可能会遇到停机或 400/500 错误。我几乎可以肯定我需要使用 configdeploy 挂钩,但不知道如何使用。谢谢!配置:在 64 位 Amazon Linux/2.7.3 上运行的 Python 3.40_python.configoption_settings: aws:elasticbeanstalk:container:python: WSGIPath: 'configs/wsgi.py' NumProcesses: 6 NumThreads: 15container_commands: 01_wsgipass: command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf' 02_traceenable: command: 'echo "TraceEnable Off" >> ../wsgi.conf'1_apache.configcontainer_commands: 01_setup_apache: command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"files: "/etc/httpd/conf.d/ssl_rewrite.conf": mode: "000644" owner: root group: root content: | RewriteEngine On <If "-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https'"> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] </If> "/etc/httpd/conf.d/wsgi_custom.conf": mode: "000644" owner: root group: root content: | WSGIApplicationGroup %{GLOBAL}
1 回答
精慕HU
TA贡献1845条经验 获得超8个赞
你可以在.config文件中设置你的环境变量
option_settings:
aws:elasticbeanstalk:application:environment:
FOO: bar
添加回答
举报
0/150
提交
取消