I get 502 Bad Gateway for some requests on my server. I get it for some particular AJAX requests but if I replay the failed request in the console, it works (wtf). In nginx/error.log
it says
[error] 13867#0: *74180 recv() failed (104: Connection reset by peer) while reading response header from upstream
My website is in PHP. Thanx
I had similar problem on wordpress site. add these lines inside http
block of /etc/nginx/nginx.conf
file.
fastcgi_temp_file_write_size 10m;
fastcgi_busy_buffers_size 512k;
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;
If it still not working also add this line
client_max_body_size 50M;
I had similar problem with my gitlab setup on nginx. What helped solve my problem was to higher max client's body size by client_max_body_size 50m
directive inside http
block of /etc/nginx/nginx.conf
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With