1. 查看当前版本
nginx -V
2. 备份配置文件
cp -r /etc/nginx /etc/nginx.bak
3. 更新包管理器
apt-get update
4. 下载 NGINX 1.27.1 源码或安装包
wget https://nginx.org/download/nginx-1.27.1.tar.gz
5. 解压并编译 NGINX 源码
tar -xzvf nginx-1.27.1.tar.gz
cd nginx-1.27.1
./configure --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module
make
make install
6. 检查和启动 NGINX
nginx -v
systemctl restart nginx