# 创建目录
mkdir -p /usr/local/softwares/packages && cd /usr/local/softwares/packages
# 下载
wget https://nginx.org/download/nginx-1.25.1.tar.gz
git clone --recursive https://gitee.com/abool/ngx_brotli.git
# 解压
tar -xf nginx-1.25.1.tar.gz
# 进入目录
cd nginx-1.25.1
# 编译
./configure \
--prefix=/usr/local/softwares/nginx \
--pid-path=/usr/local/softwares/nginx/logs/nginx.pid \
--lock-path=/usr/local/softwares/nginx/logs/nginx.lock \
--error-log-path=/usr/local/softwares/nginx/logs/error.log \
--http-log-path=/usr/local/softwares/nginx/logs/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/usr/local/softwares/nginx/temp/client \
--http-proxy-temp-path=/usr/local/softwares/nginx/temp/proxy \
--http-fastcgi-temp-path=/usr/local/softwares/nginx/temp/fastcgi \
--http-uwsgi-temp-path=/usr/local/softwares/nginx/temp/uwsgi \
--http-scgi-temp-path=/usr/local/softwares/nginx/temp/scgi \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-stream \
--with-http_v2_module \
--with-http_v3_module \
--with-http_realip_module \
--add-module=/usr/local/softwares/packages/ngx_brotli
# 安装
make && make install
# 配置文件夹
mkdir -p /usr/local/softwares/nginx/temp/client
# 查看版本号
/usr/local/softwares/nginx/sbin/nginx -v
# 测试配置文件
/usr/local/softwares/nginx/sbin/nginx -t