I have deployed the MERN stack project successfully . But now i am getting 502 Bad Gateway nginx/1.18.0 (Ubuntu). however the server is not running properly i am not able to fetch the backend data .please resolve this problem so that i will get out from this error.
Thanks
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!
In order to fix the issue, I’ll recommend you checking the Nginx error_log. This error_log will provide you with the exact reason behind the 502 Bad Gateway error you received on Nginx.
If unsure, you should be able to find where your error_log file is located from your /etc/nginx folder in the configuration file of your domain.
If you find the error, post it here so that we can give some suggestions on how to proceed.
Regards, KFSys
Hello @dailychoices2020,
Thanks for reaching out. A 502 Bad Gateway Error is a general indicator that there’s something wrong with a website’s server communication. Since it’s just a generic error, it doesn’t actually tell you the website’s exact issue. I recommend you to first check the Nginx error logs for more information.
/var/log/nginx/error.log
You can also refer to our Community answer here for more details https://www.digitalocean.com/community/questions/502-bad-gateway-nginx-2?answer=62972
Hope this helps!
Cheers, Lalitha
i have done this test with this command as well /var/log/nginx/error.log. However i found that there are some controllers in my web Application and routes it’s showing the same way as i have coded but i am getting confused how to fix it
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.