更新apt-get源
sudo apt-get update
安装
sudo apt-get install nginx
systemctl enable nginx
安装包安装
apt-get install gcc -y
apt-get install libpcre3 libpcre3-dev -y
apt-get install zlib1g zlib1g-dev -y
apt-get install openssl libssl-dev -y
tar -xvf nginx-1.20.2.tar.gz
./configure --prefix=/usr/local/nginx
–with-http_ssl_module
–with-http_v2_module
–with-http_realip_module
–with-http_stub_status_module
–with-http_gzip_static_module
–with-pcre
–with-stream
–with-stream_ssl_module
–with-stream_realip_module
make
make install