Home  >  Q&A  >  body text

nodejs-express - Node is developed locally and can run normally. How to deploy it to nginx for running?

Project structure:

I just packaged and deployed the node folder. I also know the reason is that the corresponding dependency node_modules has not been deployed.

Question:
Is it similar to vue or reactJs? After compiling through the packaging script, you only need to deploy the code after the build.

Remarks:
Front-end development, start learning node. The node on nginx has been configured. I also wrote a demo deployment using the http module of the node directly, and it can run normally.

仅有的幸福仅有的幸福2714 days ago479

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-05-16 17:10:32

    The node on nginx has been configured

    How should we understand this sentence? Does the questioner mean linux? Please describe the problem clearly first

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:10:32

    Just add a location in nginx.conf to configure the proxy.

    For example, if the listening port of my node project is 9189, it can be configured as follows:

    location /www {
        root /export/www/;
        proxy_pass http://127.0.0.1:9189;
    }

    reply
    0
  • 某草草

    某草草2017-05-16 17:10:32

    Just reverse proxy

    reply
    0
  • Cancelreply