赞
踩
进入nginx安装目录下, 执行
./sbin/nginx -V
可以看到当前nginx的版本信息
nginx version: nginx/1.17.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
built with OpenSSL 1.1.1i 8 Dec 2020
TLS SNI support enabled
configure arguments: --prefix=/extusr/software/nginx --with-http_ssl_module --with-stream --with-pcre=/extusr/software/nginx-install-package/pcre-8.42 --with-zlib=/extusr/software/nginx-install-package/zlib-1.2.11 --with-openssl=/extusr/software/nginx-install-package/openssl-1.1.1i --add-module=/extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master
nginx官方下载地址
服务器可以连公网的话可以直接wget下载
wget http://nginx.org/download/nginx-1.21.6.tar.gz
https://github.com/chobits/ngx_http_proxy_connect_module
tar zxvf nginx-1.21.6.tar.gz
解压之后进入安装目录
cd nginx-1.21.6
patch -p1 < /extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_102101.patch
./configure --prefix=/extusr/software/nginx --with-http_ssl_module --with-stream --with-pcre=/extusr/software/nginx-install-package/pcre-8.42 --with-zlib=/extusr/software/nginx-install-package/zlib-1.2.11 --with-openssl=/extusr/software/nginx-install-package/openssl-1.1.1i --add-module=/extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master
make
mv /extusr/software/nginx/sbin/nginx /extusr/software/nginx/sbin/nginx-1.17.1
cp objs/nginx /extusr/software/nginx/sbin/
sudo kill -USR2 `cat /extusr/software/nginx/logs/nginx.pid`
sudo kill -WINCH `cat /extusr/software/nginx/logs/nginx.pid.oldbin`
执行
./sbin/nginx -V
可以看到nginx的版本信息已成功升级为1.21.6。至此,大功告成!
nginx version: nginx/1.21.6
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
built with OpenSSL 1.1.1i 8 Dec 2020
TLS SNI support enabled
configure arguments: --prefix=/extusr/software/nginx --with-http_ssl_module --with-stream --with-pcre=/extusr/software/nginx-install-package/pcre-8.42 --with-zlib=/extusr/software/nginx-install-package/zlib-1.2.11 --with-openssl=/extusr/software/nginx-install-package/openssl-1.1.1i --add-module=/extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master
此外,如果nginx目录为默认目录/usr/local/nginx,则替换下nginx路径即可,示例如下:
tar zxvf nginx-1.21.6.tar.gz
cd nginx-1.21.6
patch -p1 < /extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_102101.patch
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-stream --with-pcre=/extusr/software/nginx-install-package/pcre-8.42 --with-zlib=/extusr/software/nginx-install-package/zlib-1.2.11 --with-openssl=/extusr/software/nginx-install-package/openssl-1.1.1i --add-module=/extusr/software/nginx-install-package/ngx_http_proxy_connect_module-master
make
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx-1.14.0
cp objs/nginx /usr/local/nginx/sbin/
sudo kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
sudo kill -WINCH `cat /usr/local/nginx/logs/nginx.pid.oldbin`
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。