我有一个在弹性豆茎上运行python flask 应用程序的安装程序。我的问题是我得到了这个414错误代码。我已经将LimitRequestLine 200000
添加到httpd.conf
,并在ec2示例的shell上用sudo httpd service restart
重新启动,但它似乎没有做到这一点。
这对于运行在ec2上而不是弹性beanstalk上的apache服务器来说是完美的。
我真的很感激你能帮我...
另一件奇怪的事情-如果我从ec2示例上的shell重启httpd服务,长uri可以传递一次,并且只有一次-第二次我再次得到414。
谢谢
3条答案
按热度按时间tjrkku2a1#
另一种方法是直接修改负载平衡器以增加参数“large_client_header_buffers”。这可能需要应用负载平衡器(与默认的传统负载平衡器相比)。
例如,在.ebextensions文件夹中创建文件files.config
bvhaajcl2#
LimitRequestLine
应该位于<VirtualHost>
部分中。在Elastic Beanstalk中做这件事相当棘手,因为您需要将此行添加到/etc/httpd/conf.d/wsgi.conf
中,而/etc/httpd/conf.d/wsgi.conf
是在运行commands
和container_commands
* 之后 * 自动生成的。按照this博客中的想法,将以下内容添加到.ebextensions
下的配置文件中:hec6srdp3#
由于我在EB中使用了Docker平台,或者是因为最近情况发生了变化,这些答案对我都不起作用。我通过从/etc/nginx/nginx.conf(在一个正在运行的EB示例中)获取默认的nginx.conf,然后添加“large_client_header_buffers 16 1 M;“指向Docker应用程序的proxy_pass指令中。
然后将nginx.conf文件放在.platform/nginx下(因为nginx配置将忽略.ebextensions)。
您的配置文件可能会有所不同,所以我建议使用该配置文件,但这是我的工作文件: