安装 Nginx 并配置负载均衡

 

1,在节点 192.168.1.40 上执行安装 nginx,操作如下:

01
02
03
sudo apt-add-repository ppa:nginx/development
sudo apt-get update
sudo apt-get install nginx

nginx启动命令为 sudo /etc/init.d/nginx start   或者 service nginx start

多说几句,以下是对 nginx 的几个参数的说明

  • start – 启动
  • stop – 停止
  • restart – 重启动
  • reload – 热加载配置文件
  • status – 查看状态

直接访问 http://192.168.1.40 看看 nginx 是否安装成功

原文地址:https://www.cnblogs.com/fx2008/p/4166374.html