Nodejs production environment, is it necessary to use nginx as an agent?

  node.js, question

Nodejs production environment, is it necessary to use nginx as an agent?
What is the problem with using nodejs directly?

What is the problem with using nodejs directly

If your project is small and you have fewer customers, it may be really no problem.

Why use nginx

  1. More flexible configuration, for example, I now want to redirect a special request to another address.nginxCan be directly configured. But if you go directlynodeThe program is external, then you must change the code and restart the server

  2. Use80Port, read the official website all know,nodeThe community is actually very, very not recommended for you to use.sudoThenodeProgram activation80Port ofnginxThe reverse agent is good

  3. load balancing

  4. Record public log

  5. …..

There are really too many