My website operated normally for a period of time after its release, but after a period of time, 502 visits appeared after the visits came up, and all visits were 502. Only after restarting the IIS application pool can I have normal access. However, the same problem will occur after a while.
502 Bad Gateway
This means that 500 errors have occurred in the application behind the gateway. So what you have to do is find out what this 500 error is, look at the error message and stack. Depending on how you handle the exception, the error message may be in your application log or in a Windows event, look for it yourself.
PS: This problem seems to have nothing to do with MongoDB. The label is not quite right.