标签:tps root cat 域名 dom roo proxy upstream npm
#1 ,home目录下 下载nodejs安装包,解压 并修改文件夹名称
wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar.xz
tar xvf node-v8.11.4-linux-x64.tar.xz
mv node-v8.11.4-linux-x64 node-v8
# 2,做软连接配置node 命令 和 npm
[root@node]# ln -s /home/wwwroot/node/node-v8/bin/node /usr/local/bin/
[root@ node]# ln -s /home/wwwroot/node/node-v8/bin/npm /usr/local/bin/
[root@ node]# node -v
v8.11.4
#3,更改node模块文件夹的权限
[root@ node]# chgrp www node_modules/
[root@ node]# chown www node_modules/
#4,配置nginx
upstream nodejs{
server 127.0.0.1:8001;
keepalive 64;
}
server {
listen 80;
server_name node.domain.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
proxy_pass http://nodejs;
}
}
#5,重新加载nginx 配置文件
service nginx reload
标签:tps root cat 域名 dom roo proxy upstream npm
原文地址:https://www.cnblogs.com/fslnet/p/11597959.html