简体   繁体   English

Nginx 服务器为某些目录返回错误 502(快速应用程序)

[英]The Nginx server returns error 502 for some directories (Express Application)

I'm running an express application using nginx web server on Ubuntu.我正在使用 Ubuntu 服务器上的 nginx web 服务器运行快速应用程序。 everything works fine but today when I added two more directories using app.get method and re-deploy my app, the new directories won't work and it returns 502 Bad Gateway errors (old directoriesn are working fine).一切正常,但今天当我使用app.get方法添加了两个目录并重新部署我的应用程序时,新目录将不起作用,它返回 502 Bad Gateway 错误(旧目录工作正常)。 Restarting pm2, nginx and the server itself didn't help.重新启动 pm2、nginx 和服务器本身没有帮助。 What should I do?我应该怎么办?

After a couple of hours I realized that the problem was in my code and not relevant to nginx.几个小时后,我意识到问题出在我的代码中,与 nginx 无关。 But because of pm2 the server would not crash to help me find that out.但是由于 pm2,服务器不会崩溃以帮助我找出答案。 running normal run command:运行正常运行命令:

node server.js

revealed the mistake揭露了错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM