Nginx 502 Bad Gateway on some search queries

December 4, 2017 2.5k views
Django Nginx MySQL Ubuntu 16.04

Hi guys,
I have written a dictionary website, it works fine, but on some queries i receive bad gateway, the nginx log is written below:

upstream prematurely closed connection while reading response header from upstream

what is my problem exactly, cause everything is fine and it works for most of the queries, and i get response for those queries on my local server.
Is it my server RAM?
My server has 512 MB RAM, and 1 CPU.

1 Answer

Why it is happening.Need a solution.I am fed up with this.
Alzheimers care Tampa

Have another answer? Share your knowledge.