*25 upstream prematurely closed connection while reading response header from upstream. Flask + AWS ELB

Viewed 256

I'm using AWS ELB to deploy flask backend api. I have an endpoint that uploads a file and another endpoint that reads data from the file.

Every other endpoint works fine but when I run the endpoint that reads data the file that was uploaded it runs for about 30 seconds and it throws the 502 bad gateway error.

ELB error: 2022/03/08 17:30:19 [error] 25807#25807: *25 upstream prematurely closed connection while reading response header from upstream, client: 172.31.0.71,

.platforms/nginx/conf.d/myconfig.conf:

keepalive_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
fastcgi_send_timeout 3600s;
fastcgi_read_timeout 3600s;
client_header_timeout 3600s;
client_body_timeout 3600s;
send_timeout 3600s;
uwsgi_read_timeout 3600s;
uwsgi_send_timeout 3600s;
uwsgi_socket_keepalive on;

I have tried a whole lot of answers but none has worked for me. Please I need help

0 Answers
Related