1.新建目录nginx,下载需要的软件
wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
wget https://zlib.net/zlib-1.2.11.tar.gz
wget http://nginx.org/download/nginx-1.17.1.tar.gz
2.进入nginx目录解压下载的文件
ls *.tar.gz | xargs -n1 tar xzvf
3.编译安装
./configure --prefix=/usr/local/nginx --with-openssl=../openssl-1.0.2s --with-pcre=../pcre-8.43 --with-zlib=../zlib-1.2.11 --with-pcre-jit --user=root --with-http_ssl_module --with-http_v2_module
make
make install
来源:oschina
链接:https://my.oschina.net/sky2008/blog/4771011