Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

amazon web services - Nginx: Client request body is buffered to a temporary file

I've deployed a ML Model on AWS. It's an image classifier. When I provide the following images to the ML Model via a form in Flask, it works in certain cases but doesn't work in other cases.

The link of the image which work is listed below: https://drive.google.com/file/d/1hbrEa2gNLdqGPJxp5jVxWcXl1wunp5Mc/view?usp=sharing

The link of the image which gives an error is listed below: https://drive.google.com/file/d/1znWTRnTMPft_r_jwpJ0JQuMnnazsUXs-/view?usp=sharing

Both of the above images look alike. The first image which is around 150kb of size works when I select the file and upload it for analysis. The image which is around 10kb however doesn't when I select and upload it for analysis from a PC. When I try to do the same with my mobile phone browser, both show an error.

The error shown in the logs is - [warn]: a client request body is buffered to a temporary file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I figured out the answer by following this link: Increasing client_max_body_size in Nginx conf on AWS Elastic Beanstalk The nginx configuration settings should be performed in a folder named .platform.

The folder structure is (.platform/nginx/conf.d/proxy.conf)

Inside the proxy.conf mention:

client_body_buffer_size 50M;(the size according to your requirement).

Inside the .platform folder make another file named 00_myconf.config with the following contents:

container_commands:
 01_reload_nginx:
   command: "service nginx reload"

AWS documentation regarding configuring nginx: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html (Read the reverse proxy configuration)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...