Nginx 1.27.1 源码安装

**Ubuntu24 TLS**

cd /usr/local/src

sudo apt update
sudo apt install -y build-essential zlib1g-dev libpcre3-dev libssl-dev libgd-dev libgeoip-dev git  




git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli/
git submodule update --init 

cd ..

wget https://nginx.org/download/nginx-1.27.1.tar.gz && tar zxvf nginx-1.27.1.tar.gz && cd nginx-1.27.1/



./configure --prefix=/usr/local/nginx1.27 \
    --with-http_dav_module \
    --with-http_addition_module \
    --with-http_realip_module \
    --with-http_sub_module \
    --with-http_flv_module \
    --with-http_mp4_module \
    --with-http_ssl_module \
    --with-http_v2_module \
    --with-http_gunzip_module \
    --with-http_stub_status_module \
    --with-http_gzip_static_module \
    --with-http_secure_link_module \
    --with-http_image_filter_module \
    --with-http_random_index_module \
    --with-http_auth_request_module \
    --with-stream \
    --with-stream_realip_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-stream_geoip_module=dynamic \
    --with-threads \
    --with-pcre \
    --with-pcre-jit \
    --with-compat \
    --with-select_module \
    --with-poll_module \
    --with-mail \
    --with-mail_ssl_module  \
    --user=www-data \
    --group=www-data \
    --add-module=../ngx_brotli 


make && make install
ln -s /usr/local/nginx1.27/sbin/nginx /usr/bin/nginx
mkdir /var/log/nginx/exc -p

**系统守护进程**

**默认配置文件**

Last updated