1.准备configuration,将以下的配置文件内容放入/etc/nginx/sites-available/node-app文件中,内容:
<p>upstream node_server {</p><p>server 127.0.0.1:3000 fail_timeout=0;</p><p>server 127.0.0.1:5000 fail_timeout=0;</p><p>server 127.0.0.1:5001 fail_timeout=0;</p><p>}</p><p>server {</p><p>listen 80;</p><p>listen [::]:80 default_server;</p><p>index index.html index.htm;</p><p>server_name www.abc.com;</p><p>location / {</p><p>proxy_set_header Host $host;</p><p>proxy_set_header X-Real-IP $remote_addr;</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/xiazai/code/9005">
<img src="https://img.php.cn/upload/webcode/000/000/006/175760100324071.jpg" alt="极品模板 - 企业电商网站管理系统">
</a>
<div class="aritcle_card_info">
<a href="/xiazai/code/9005">极品模板 - 企业电商网站管理系统</a>
<p>【极品模板】出品的一款功能强大、安全性高、调用简单、扩展灵活的企业电商网站管理系统。 产品主要功能如下: 多模型管理 自带文章、商品模型(可增加其他模型) 会员插件 会员分组/实名认证/快捷登录/自动升级 订单插件 订单管理、售后管理、优惠券、数据报表 城市分站 自定义TKD/首页模板/独立内容/二级域名绑定 </p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="极品模板 - 企业电商网站管理系统">
<span>3</span>
</div>
</div>
<a href="/xiazai/code/9005" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="极品模板 - 企业电商网站管理系统">
</a>
</div>
<p>proxy_redirect off;</p><p>proxy_buffering off;</p><p>proxy_pass http://node_server;</p><p>}</p><p>location /public/ {</p><p>root /opt/app;</p><p>}</p><p>}</p>2.在终端运行以下命令即可:
<p>sudo rm /etc/nginx/sites-enabled/default</p><p>sudo ln -s /etc/nginx/sites-available/node-app /etc/nginx/sites-enabled/node-app</p><p>sudo /etc/init.d/nginx restart</p>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号