簡體   English   中英

client_max_body_size 在 Nginx conf 中,但似乎被忽略了

[英]client_max_body_size is in Nginx conf but seems to be getting ignored

我遇到了狀態碼413 Request Entity Too Large 我在 AWS 的 Elastic Beanstalk 上運行一個 Amazon Linux 2 AMI 實例,該實例運行一個快速服務器,該服務器具有一個將文件上傳到 S3 存儲桶的發布路由,然后都將一些數據添加到表中並生成一條 kafka 消息。 對於小於 1MB 的文件,一切正常。

我了解 nginx 的默認最大大小值為 1MB,我必須更改它。

我嘗試了這個線程中的每個答案, 增加了 AWS Elastic Beanstalk 上 Nginx conf 中的 client_max_body_size,但盡管得到了client_max_body_size 10M; inside the nginx.conf file, and restarting nginx everytime I changed a configuration, using nginx -t to see if anything was wrong with the syntax, resulting in everything being ok , and finally proving via this command that the client_max_body_size 10M; 該行實際上就在那里,當它指責文件中有它的副本時,每當我嘗試發布大於 1MB 的文件時,我的微服務似乎完全忽略了所有這些配置。

我對從這里開始的地方沒有太多想法。 有小費嗎?

您提供的鏈接適用於 Amazon Linux 1 (AL1)。 現在所有的EB平台都是基於AL2的,nginx的設置不同 即,您應該在應用程序的根目錄中創建.platform/nginx/conf.d/myconfig.conf文件,其內容為:

client_max_body_size 10M;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM