502 Bad Gateway in Digital Ocean Server
Known:
- Operating System: Ubuntu
- Web Server : Nginx
- Web Application : Nuxt.js
Problem:
My client had problem with “502 Bad Gateway”
Nginx Log:
I wrote “tail -f /var/log/nginx/error.log” which result :
connect() failed (111: Connection refused while connecting to upstream, client: ***.***.***.***, Server: domainName.co.id, request: GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico"
Question:
How to fix this issue …. ?
Reply:
I check the list of node JS process by wrote “pm2 list” that resulted no one process exist.
So i decided to enter the /var/www/domainName and wrote “pm2 start” then the process up and the website up too.