Nginx 502 Bad Gateway on some search queries

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.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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