Nginx 502 Bad Gateway on some search queries
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.