Unitech / Unitech/pm2

PM2 with 502 Gateway error

Open
#5,627 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

Hi, recently I have been using IIS as a reverse proxy to rewrite a node application URL. I am using PM2 as the manager to start the NodeJs program. However, I did notice that after some hours, when the user triggers the application again, it will always display the following message:
502 - Web server received an invalid response while acting as a gateway or proxy server.

Then, when the user refreshes, the application works again. I wonder if PM2 has any mechanism that sleeps after a period of time. Any advice or reference?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing PM2 process status and logs with the IIS reverse-proxy logs when the 502 occurs after several hours. Determine whether the Node.js application remains running and whether refreshing changes the response; done means identifying a reproducible PM2-related cause or documenting that the failure is in the IIS proxy configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.