我得到网络错误413 Request Entity Too Large
,即使配置的大小限制是50mb,有效载荷大小比这短得多。
Status Code: 413 Request Entity Too Large
响应标头:
Connection: close
Content-Length: 585
Content-Type: text/html
Date: Tue, 19 Oct 2021 15:36:06 GMT
Server: nginx/1.20.0
请求头:
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: en,es-ES;q=0.9,es;q=0.8
Connection: keep-alive
Content-Length: 2072572
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: ...
Host: ...
Origin: ...Referer: http://devxd.us-east-1.elasticbeanstalk.com/admin/post/edit/22/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
X-Requested-With: XMLHttpRequest
在我的nginx。配置文件:
files:
/etc/nginx/conf.d/proxy.conf:
owner: root
group: root
mode: "000644"
content: |
client_max_body_size 50M;
# Elastic Beanstalk Managed
...
奇怪的是,这个配置在prod中工作得很好
解决方案是更新配置文件如下:
路径>.platform/nginx/conf.d/elasticbeanstalk/max_bodysize.conf
client_max_body_size 50M;