nodejs-express - Node is developed locally and can run normally. How to deploy it to nginx for running?
仅有的幸福
仅有的幸福 2017-05-16 17:08:32
0
3
471

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.

仅有的幸福
仅有的幸福

reply all(3)
刘奇

The node on nginx has been configured

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

给我你的怀抱

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;
}
某草草

Just reverse proxy

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!