3

I have a Django app with which users can create video collages using multiple videos. Problem is, on production, when uploading videos to amazon s3, I get a 502 bad gateway (works fine locally). Does anyone know what could be wrong? I already set

client_max_body_size 100M

and

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 3000;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;

Does anyone know what could be wrong? Thanks in advance

Full error:

2017/12/31 23:50:51 [error] 1279#1279: *1 upstream prematurely closed connection while reading response header from upstream, 
client: 107.205.110.154, 
server: movingcollage.com, 
request: "POST /create-collage/ HTTP/1.1", 
upstream: "http://unix:/home/mike/movingcollage/movingcollage.sock:/create-collage/", 
host: "movingcollage.com", referrer: "http://movingcollage.com/create-collage/"

1 Answer 1

7

If the problem were in nginx timeout it would give you 504 error. 502 error means that this error could happen due to timeout in process behind nginx, gunicorn in your case I guess. Try to launch it with -t 3000 param (to match your nginx conf).

1
  • Hi Kirill, could you please show the code? I am new to use Nginx and I have tried: systemctl restart nginx -t 3000 which shows an error: Unknown unit type or load state '3000s'.
    – Franva
    May 24, 2021 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.