Centos6.5环境Nginx 1.16.1升级到1.24.0版本

一、背景

在这里插入图片描述

2023年4月11日,官方发布了Nginx最新稳定版,版本号为 1.24.0。该版本是基于1.23.x(1.23.0 - 1.23.4)开发版的Bug修复,以及一些新特性的加入,而形成的稳定版。安全部门扫描后,发现现场不满足要求,下发通知整改升级到该版本;

资料地址: http://nginx.org/en/download.html;安全页版本说明

涉及漏洞:

漏洞 风险等级 升级版本
nginx 安全漏洞(CVE-2021-23017) [高] nginx 1.21.0+, 1.20.1+
nginx 缓冲区错误漏洞(CVE-2022-41741) [高] nginx 1.23.2+, 1.22.1+
nginx 越界写入漏洞(CVE-2022-41742) [高] nginx 1.23.2+, 1.22.1+
NGINX 环境问题漏洞(CVE-2019-20372) [中] nginx 1.24.0

现场环境:centos6.5 nginx 1.16.1 pcre 7.8 openssl 1.1.1k

二、升级过程

1、当前版本检查确认

nginx version: nginx/1.16.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) 
built with OpenSSL 1.1.1k  25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-openssl=/home/software/openssl-1.1.1k --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'


在这里插入图片描述
2、备份:配置文件和二进制文件

cp -pr /etc/nginx/nginx.conf ./nginx.conf_20230530
cp -pr /usr/sbin/nginx ./nginx_20230530

3、编译安装

wget http://nginx.org/download/nginx-1.24.0.tar.gz
tar -xzf nginx-1.24.0.tar.gz
pcre-config --version  #现场为7.8
cd nginx-1.24.0
vim scr/core/nginx.conf  #隐藏版本

1 #define NGINX_VERSION “1.2X”
2 #define NGINX_VER “nginx/” NGINX_VERSION

./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-openssl=/home/software/openssl-1.1.1k --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module  --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'  #--prefix=/usr/local/nginx后不要写/

#/home/software/openssl-1.1.1k 
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --modules-path=/usr/lib64/nginx/modules  --with-pcre=/lib64/ --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-openssl=/home/software/openssl-1.1.1k --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module

make -j4
cd objs
ls  #如下
autoconf.err  nginx    ngx_auto_config.h   ngx_modules.c  src
Makefile      nginx.8  ngx_auto_headers.h  ngx_modules.o
which nginx  #再次确认
/usr/sbin/nginx
mv /usr/sbin/nginx /usr/sbin/nginx.20230530
cp ./nginx /usr/sbin/   #复制新的文件夹替换原二进制目录
nginx -t  #验证,确认如下输出
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

kill -USR2 `cat /var/run/nginx.pid`   #平滑升级
kill -QUIT `cat /var/run/nginx.pid.oldbin`
#向旧的Nginx 主进程(master)发送 WINCH 信号,它会逐步关闭自己的工作进程(主进程不 退出),这时所有请求都会由新版 Nginx 处理
kill -WINCH `cat /var/run/nginx.pid.oldbin` 
或直接
make upgrade #相当于以上2步骤的一起操作
ake upgrade  #执行后自动进行升级节约我们手敲几个命令仅此而已
/opt//nginx/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
kill -USR2 `cat /var/run/nginx.pid`
sleep 1
test -f /etc/nginx/nginx.conf
kill -QUIT `cat /var/run/nginx.pid.oldbin`

vim /etc/nginx/nginx.conf  #
server_tokens off;

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

编译参数回顾:

–prefix= 指向安装目录

–sbin-path 指向(执行)程序文件(nginx)

–conf-path= 指向配置文件(nginx.conf)

–error-log-path= 指向错误日志目录

–pid-path= 指向pid文件(nginx.pid)

–lock-path= 指向lock文件(nginx.lock)(安装文件锁定,防止安装文件被别人利用,或自己误操作。)

–user= 指定程序运行时的非特权用户

–group= 指定程序运行时的非特权用户组

–builddir= 指向编译目录

–with-rtsig_module 启用rtsig模块支持(实时信号)

–with-select_module 启用select模块支持(一种轮询模式,不推荐在高载环境下使用)禁用:–without-select_module

–with-poll_module 启用poll模块支持(功能与select相同,与select特性相同,为一种轮询模式,不推荐在高载环境下使用)

–with-file-aio 启用file aio支持(一种APL文件传输格式)

–with-ipv6 启用ipv6支持

–with-http_ssl_module 启用ngx_http_ssl_module支持(使支持https请求,需已安装openssl)

–with-http_realip_module 启用ngx_http_realip_module支持(这个模块允许从请求标头更改客户端的IP地址值,默认为关)

–with-http_addition_module 启用ngx_http_addition_module支持(作为一个输出过滤器,支持不完全缓冲,分部分响应请求)

–with-http_xslt_module 启用ngx_http_xslt_module支持(过滤转换XML请求)

–with-http_image_filter_module 启用ngx_http_image_filter_module支持(传输JPEG/GIF/PNG 图片的一个过滤器)(默认为不启用。gd库要用到)

–with-http_geoip_module 启用ngx_http_geoip_module支持(该模块创建基于与MaxMind GeoIP二进制文件相配的客户端IP地址的ngx_http_geoip_module变量)

–with-http_sub_module 启用ngx_http_sub_module支持(允许用一些其他文本替换nginx响应中的一些文本)

–with-http_dav_module 启用ngx_http_dav_module支持(增加PUT,DELETE,MKCOL:创建集合,COPY和MOVE方法)默认情况下为关闭,需编译开启

–with-http_flv_module 启用ngx_http_flv_module支持(提供寻求内存使用基于时间的偏移量文件)

–with-http_gzip_static_module 启用ngx_http_gzip_static_module支持(在线实时压缩输出数据流)

–with-http_random_index_module 启用ngx_http_random_index_module支持(从目录中随机挑选一个目录索引)

–with-http_secure_link_module 启用ngx_http_secure_link_module支持(计算和检查要求所需的安全链接网址)

–with-http_degradation_module 启用ngx_http_degradation_module支持(允许在内存不足的情况下返回204或444码)

–with-http_stub_status_module 启用ngx_http_stub_status_module支持(获取nginx自上次启动以来的工作状态)

–without-http_charset_module 禁用ngx_http_charset_module支持(重新编码web页面,但只能是一个方向–服务器端到客户端,并且只有一个字节的编码可以被重新编码)

–without-http_gzip_module 禁用ngx_http_gzip_module支持(该模块同-with-http_gzip_static_module功能一样)

–without-http_ssi_module 禁用ngx_http_ssi_module支持(该模块提供了一个在输入端处理处理服务器包含文件(SSI)的过滤器,目前支持SSI命令的列表是不完整的)

–without-http_userid_module 禁用ngx_http_userid_module支持(该模块用来处理用来确定客户端后续请求的cookies)

–without-http_access_module 禁用ngx_http_access_module支持(该模块提供了一个简单的基于主机的访问控制。允许/拒绝基于ip地址)

–without-http_auth_basic_module禁用ngx_http_auth_basic_module(该模块是可以使用用户名和密码基于http基本认证方法来保护你的站点或其部分内容)

–without-http_autoindex_module 禁用disable ngx_http_autoindex_module支持(该模块用于自动生成目录列表,只在ngx_http_index_module模块未找到索引文件时发出请求。)

–without-http_geo_module 禁用ngx_http_geo_module支持(创建一些变量,其值依赖于客户端的IP地址)

–without-http_map_module 禁用ngx_http_map_module支持(使用任意的键/值对设置配置变量)

–without-http_split_clients_module 禁用ngx_http_split_clients_module支持(该模块用来基于某些条件划分用户。条件如:ip地址、报头、cookies等等)

–without-http_referer_module 禁用disable ngx_http_referer_module支持(该模块用来过滤请求,拒绝报头中Referer值不正确的请求)

–without-http_rewrite_module 禁用ngx_http_rewrite_module支持(该模块允许使用正则表达式改变URI,并且根据变量来转向以及选择配置。如果在server级别设置该选项,那么他们将在 location之前生效。如果在location还有更进一步的重写规则,location部分的规则依然会被执行。如果这个URI重写是因为location部分的规则造成的,那么 location部分会再次被执行作为新的URI。 这个循环会执行10次,然后Nginx会返回一个500错误。)

–without-http_proxy_module 禁用ngx_http_proxy_module支持(有关代理服务器)

–without-http_fastcgi_module 禁用ngx_http_fastcgi_module支持(该模块允许Nginx 与FastCGI 进程交互,并通过传递参数来控制FastCGI 进程工作。 )FastCGI一个常驻型的公共网关接口。

–without-http_uwsgi_module 禁用ngx_http_uwsgi_module支持(该模块用来医用uwsgi协议,uWSGI服务器相关)

–without-http_scgi_module 禁用ngx_http_scgi_module支持(该模块用来启用SCGI协议支持,SCGI协议是CGI协议的替代。它是一种应用程序与HTTP服务接口标准。它有些像FastCGI但他的设计 更容易实现。)

–without-http_memcached_module 禁用ngx_http_memcached_module支持(该模块用来提供简单的缓存,以提高系统效率)

-without-http_limit_zone_module 禁用ngx_http_limit_zone_module支持(该模块可以针对条件,进行会话的并发连接数控制)

–without-http_limit_req_module 禁用ngx_http_limit_req_module支持(该模块允许你对于一个地址进行请求数量的限制用一个给定的session或一个特定的事件)

–without-http_empty_gif_module 禁用ngx_http_empty_gif_module支持(该模块在内存中常驻了一个1*1的透明GIF图像,可以被非常快速的调用)

–without-http_browser_module 禁用ngx_http_browser_module支持(该模块用来创建依赖于请求报头的值。如果浏览器为modern ,则 m o d e r n b r o w s e r 等于 m o d e r n b r o w s e r v a l u e 指令分配的值;如果浏览器为 o l d ,则 modern_browser等于modern_browser_value指令分配的值;如 果浏览器为old,则 modernbrowser等于modernbrowservalue指令分配的值;如果浏览器为old,则ancient_browser等于 ancient_browser_value指令分配的值;如果浏览器为 MSIE中的任意版本,则 $msie等于1)

–without-http_upstream_ip_hash_module 禁用ngx_http_upstream_ip_hash_module支持(该模块用于简单的负载均衡)

–with-http_perl_module 启用ngx_http_perl_module支持(该模块使nginx可以直接使用perl或通过ssi调用perl)

–with-perl_modules_path= 设定perl模块路径

–with-perl= 设定perl库文件路径

–http-log-path= 设定access log路径

–http-client-body-temp-path= 设定http客户端请求临时文件路径

–http-proxy-temp-path= 设定http代理临时文件路径

–http-fastcgi-temp-path= 设定http fastcgi临时文件路径

–http-uwsgi-temp-path= 设定http uwsgi临时文件路径

–http-scgi-temp-path= 设定http scgi临时文件路径

-without-http 禁用http server功能

–without-http-cache 禁用http cache功能

–with-mail 启用POP3/IMAP4/SMTP代理模块支持

–with-mail_ssl_module 启用ngx_mail_ssl_module支持

–without-mail_pop3_module 禁用pop3协议(POP3即邮局协议的第3个版本,它是规定个人计算机如何连接到互联网上的邮件服务器进行收发邮件的协议。是因特网电子邮件的第一个离线协议标 准,POP3协议允许用户从服务器上把邮件存储到本地主机上,同时根据客户端的操作删除或保存在邮件服务器上的邮件。POP3协议是TCP/IP协议族中的一员,主要用于 支持使用客户端远程管理在服务器上的电子邮件)

–without-mail_imap_module 禁用imap协议(一种邮件获取协议。它的主要作用是邮件客户端可以通过这种协议从邮件服务器上获取邮件的信息,下载邮件等。IMAP协议运行在TCP/IP协议之上, 使用的端口是143。它与POP3协议的主要区别是用户可以不用把所有的邮件全部下载,可以通过客户端直接对服务器上的邮件进行操作。)

–without-mail_smtp_module 禁用smtp协议(SMTP即简单邮件传输协议,它是一组用于由源地址到目的地址传送邮件的规则,由它来控制信件的中转方式。SMTP协议属于TCP/IP协议族,它帮助每台计算机在发送或中转信件时找到下一个目的地。)

–with-google_perftools_module 启用ngx_google_perftools_module支持(调试用,剖析程序性能瓶颈)

–with-cpp_test_module 启用ngx_cpp_test_module支持

–add-module= 启用外部模块支持

–with-cc= 指向C编译器路径

–with-cpp= 指向C预处理路径

–with-cc-opt= 设置C编译器参数(PCRE库,需要指定–with-cc-opt=”-I /usr/local/include”,如果使用select()函数则需要同时增加文件描述符数量,可以通过–with-cc- opt=”-D FD_SETSIZE=2048”指定。)

–with-ld-opt= 设置连接文件参数。(PCRE库,需要指定–with-ld-opt=”-L /usr/local/lib”。)

–with-cpu-opt= 指定编译的CPU,可用的值为: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64

–without-pcre 禁用pcre库

–with-pcre 启用pcre库

–with-pcre= 指向pcre库文件目录

–with-pcre-opt= 在编译时为pcre库设置附加参数

–with-md5= 指向md5库文件目录(消息摘要算法第五版,用以提供消息的完整性保护)

–with-md5-opt= 在编译时为md5库设置附加参数

–with-md5-asm 使用md5汇编源

–with-sha1= 指向sha1库目录(数字签名算法,主要用于数字签名)

–with-sha1-opt= 在编译时为sha1库设置附加参数

–with-sha1-asm 使用sha1汇编源

–with-zlib= 指向zlib库目录

–with-zlib-opt= 在编译时为zlib设置附加参数

–with-zlib-asm= 为指定的CPU使用zlib汇编源进行优化,CPU类型为pentium, pentiumpro

–with-libatomic 为原子内存的更新操作的实现提供一个架构

–with-libatomic= 指向libatomic_ops安装目录
–with-openssl= 指向openssl安装目录
–with-openssl-opt 在编译时为openssl设置附加参数
–with-debug 启用debug日志

三、附录

1)nginx 信号指令

在这里插入图片描述

其中,当nginx 的主进程收到USR1信号,会重新打开日志文件(以nginx配置文件中的日志名称命名,就是配置文件中access_log项所设置的值,如果文件不存在,会自动创建一个新的文件xxx.log)。然后把日志文件的拥有者改为“工作进程(worker进程)”,让worker进程就具备了对日志文件的读写权限(master和worker通常以不同用户运行,所以需要改变拥有者)。之后,nginx master进程会关闭重名的日志文件(也就是刚才使用mv命令重命名成xxx.log_ 20130909.log的文件),并通知worker进程使用新打开的日志文件(刚才主进程打开的文件xxx.log),主进程把USR1信号发给worker,worker接到这个信号后,会重新打开日志文件(也就是配置文件中约定的xxx.log)

主进程支持的信号:

TERM, INT: 立刻退出
QUIT: 等待工作进程结束后再退出
KILL: 强制终止进程
HUP:重新加载配置文件,使用新的配置启动工作进程,并逐步关闭旧进程。
USR1: 重新打开日志文件
USR2: 启动新的主进程,实现热升级
WINCH: 逐步关闭工作进程

工作进程支持的信号:

TERM, INT: 立刻退出
QUIT: 等待请求处理结束后再退出
USR1: 重新打开日志文件

在这里插入图片描述
2)平滑升级原理

Nginx 默认工作在多进程模式下,即主进程(master process)启动后完成配置加载和端口绑 定等动作,fork 出指定数量的工作进程(worker process),这些子进程会持有监听端口的文 件描述符(fd),并通过在该描述符上添加监听事件来接受连接(accept)。

而Nginx 主进程在启动完成后会进入等待状态,负责响应各类系统消息,如 SIGCHLD、SIGHUP、 SIGUSR2 等。这样我们就可以通过控制信号来控制进行,官方也提供了相关功能,比如:替换master后,发送USR2:就可启动新的主进程来完成新版本平滑替换;然后发送QUIT给旧的master进程,告知其等待旧worker进程处理当前任务结束后再退出,或者也可发送WINCH信号给旧master进程,告知其逐步worker关闭;关闭后新的master就会把请求处理转移到新的worker进程上,也可发送QUIT给旧的worker进程,告知其等待请求处理结束后再退出;至此,完成整个Nginx平滑迁移。

3)rewrite语法规则

用法:一般在跟location中(即location /{……})或直接在Server标签中编写rewrite规则,推荐使用last标记,在非跟location中(location /cms/{……}),则使用break标记

变量名可以使用"=“或”!=“运算符
“~” 符号表示区分大小写字母的匹配
“~*” 符号表示不区分大小写字母的匹配
“!~” 和”!*“与”" “!~“相反
“-f"和”!-f” 用来判断文件是否存在
“-d"和”!-d” 用来判断目录是否存在
“-e"和”!-e" 用来判断文件或目录是否存在
“-x"和”!-x" 用来判断文件是否可以执行
也支持$!到$9位置化参数

rewrite指令的最后一项参数为flag标记,支持的flag标记主要有以下几种:

last:相当于apache里的[L]标记,表示完成rewrite;
break:本条规则匹配完成后,终止匹配,不再匹配后面的规则
redirect:返回302临时重定向,浏览器地址栏会显示跳转后的URL地址
permanent:返回301永久重定向,浏览器地址栏会显示跳转后的URL地址

last和break用来实现URI重写,浏览器地址栏URL地址不变
redirect和permanent用来实现URL跳转,浏览器地址栏会显示跳转后的URL地址

4)Nginx测试页示例

#vim /usr/local/nginx/html/index.html

<html>

<head>

<title>source page</title>

</head>

<body>

<h1>www.source.com</h1>

<img src="http://t.zoukankan.com/linux.png" />

</body>

</html>

5)Nginx 盗链主机的测试页

#vim /usr/local/nginx/html/index.html

<html>

<head>

<title>steal page</title>

</head>

<body>

<h1>www.steal.com</h1>

<img src="http://www.source.com/linux.png" />

</body>

</html> 

#防盗链配置
location ~* .(wma|wmv|asf|mp3|mmf|zip|rar|jpg|gif|png|swf|flv)$ {
    
    

valid_referers none blocked *.source.com source.com;

if ($invalid_referer) {
    
    

	rewrite ^/ http://www.source.com/error.jpg;

	#return 403;

    }
 }

6)Nginx日志切割脚本示例

#!/bin/bash

# Name:cut_nginx_log.sh 

datetime=$(date -d "-1 day" "+%Y%m%d")

log_path="/usr/local/nginx/logs"

pid_path="/usr/local/nginx/logs/nginx.pid"

[ -d $log_path/backup ] || mkdir -p $log_path/backup

if [ -f $pid_path ]

then
	mv $log_path/access.log $log_path/backup/access.log-$datetime
	kill -USR1 $(cat $pid_path)
	find $log_path/backup -mtime +30 | xargs rm -f

else
	echo "Error,Nginx is not working!" | tee -a /var/log/messages

fi

7)Nginx补丁(patch)格式说明

diff --git src/http/modules/ngx_http_mp4_module.c src/http/modules/ngx_http_mp4_module.c
--- src/http/modules/ngx_http_mp4_module.c  //表示安全问题产生在ngx_http_mp4_module.c文件中,该行是导致风险的代码,后续已删除,不要加到ngx_files.c文件
+++ src/http/modules/ngx_http_mp4_module.c  ///表示问题要在ngx_http_mp4_module.c文件中得以修复,该行为修复安全bug新增到ngx_files.c文件中的内容
@@ -1121,6 +1121,12 @@ ngx_http_mp4_read_ftyp_atom(ngx_http_mp4  -1121,6表示修复前该处代码的位置为1121行的后6行,+1121,12表示修复后该处代码占1121行的后12行
         return NGX_ERROR;
     }
 
+    if (mp4->ftyp_atom.buf) {
    
       ///+号表示该行代码原来没有,后续修复版本要新加进去的内容;修复时+号无需再加到代码中了
+        ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
+                      "duplicate mp4 ftyp atom in \"%s\"", mp4->file.name.data);
+        return NGX_ERROR;
+    }
+
     atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
 
     ftyp_atom = ngx_palloc(mp4->request->pool, atom_size);
@@ -1179,6 +1185,12 @@ ngx_http_mp4_read_moov_atom(ngx_http_mp4
         return NGX_DECLINED;
     }
 
+    if (mp4->moov_atom.buf) {
    
    
+        ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
+                      "duplicate mp4 moov atom in \"%s\"", mp4->file.name.data);
+        return NGX_ERROR;
+    }
+

附:Nginx安全公告地址

8)Nginx打补丁过程

去nginx官网上,找到新版本以及预发布版本的补丁文件下载,然后执行:

1、上传对应版本的补丁文件,并解压至nginx源代码根目录中。
2、cd /path/to/nginx/source/code
3、patch -p1 < /path/to/patch/file //执行patch命令,将补丁文件应用于nginx源代码目录
4、./configure --add-module=module/path --prefix=与原nginx路径保持一致 //重新编译
5、make //make后参照上文二进制文件替换升级即可

猜你喜欢

转载自blog.csdn.net/ximenjianxue/article/details/130941296