'502 Bad Gateway (nginx/1.14.0 (Ubuntu))

Hi i have a server with multiple subdomain a weird issue started when all domains returned with 502 bad gateway i entered one subdomain and i run npm run dev and it worked but all the remain subdomains still 502, when i go to other subdomain and run npm start the subdomain work while all the other return 502 what should i do. here's my package for web (on a subdomain)

{
  "name": "mmy-route-web",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev -p 8080",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.16",
    "@glidejs/glide": "^3.4.0",
    "@mailchimp/mailchimp_marketing": "^3.0.43",
    "@popperjs/core": "^2.9.2",
    "@stripe/stripe-js": "^1.13.2",
    "bootstrap": "^5.0.0-beta3",
    "cloudinary-build-url": "^0.2.1",
    "cloudinary-react": "^1.7.0",
    "cookie": "^0.4.1",
    "html-react-parser": "^1.2.6",
    "lodash": "^4.17.21",
    "next": "10.0.9",
    "next-iron-session": "^4.1.12",
    "nookies": "^2.5.2",
    "npm": "^8.1.0",
    "parse": "^3.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-use-tawk": "^1.0.0",
    "sass": "^1.32.8",
    "stripe": "^8.145.0",
    "styled-components": "^5.2.1",
    "swr": "^0.5.5"
  },
  "browser": {
    "child_process": false
  }
}

and for my backend (on other subdomain):

{
  "name": "parse-server-example",
  "version": "1.4.0",
  "description": "An example Parse API server using the parse-server module",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "https://github.com/"
  },
  "license": "MIT",
  "dependencies": {
    "@parse/fs-files-adapter": "^1.2.0",
    "concurrently": "^7.0.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "jimp": "^0.16.1",
    "kerberos": "0.0.24",
    "nodemailer": "^6.4.17",
    "parse": "~1.8.0",
    "parse-dashboard": "^2.1.0",
    "parse-server": "*",
    "parse-server-cloudinary-adapter": "^1.4.0",
    "parse-server-dedicated-email-adapter": "^3.0.6",
    "parse-server-email-template-adapter": "^1.0.2",
    "parse-server-generic-email-adapter": "0.0.4",
    "parse-smtp-template": "^2.2.0",
    "slugify": "^1.4.6"
  },
  "scripts": {
    "start": "node index.js",
    "dev": "concurrently \"cd server && npm run start\" \"npm run start\""
  },
  "engines": {
    "node": ">=4.3"
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source