nginx编译配置
最新
+addition_filter
1
./configure --prefix=/usr/local/OpenResty1.17 --user=nginx --group=nginx --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_realip_module --with-pcre --with-luajit --add-module=/opt/ngx_cache_purge-2.3/ --add-module=/opt/nginx_upstream_check_module-0.3.0/ --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --add-module=/opt/tengine-2.3.2/modules/ngx_slab_stat/ --with-http_image_filter_module=dynamic --add-module=/opt/nginx-http-concat/ --with-http_sub_module --with-http_addition_module
热部署
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 移动
mv /usr/local/OpenResty1.17/nginx/sbin/nginx /usr/local/OpenResty1.17/nginx/sbin/nginx.$(date "+%Y%m%d")
# 复制编译好的二进制文件: nginx , 到正在运行的nginx sbin 下
cp /opt/openresty-1.17.8.2/build/nginx-1.17.8/objs/nginx /usr/local/OpenResty1.17/nginx/sbin/nginx
# 如果需要一些库,复制到安装的nginx目录下
cp /opt/openresty-1.17.8.2/build/nginx-1.17.8/objs/ngx_http_image_filter_module.so /usr/local/OpenResty1.17/nginx/modules/
# 优雅的关闭老进程
ps -ef | grep nginx | awk '{if ($8 ~/nginx/) print $0}'
kill -USR2 20719(master进程)
ps -ef | grep nginx | awk '{if ($8 ~/nginx/) print $0}'
kill -WINCH 20719(旧master进程)
ps -ef | grep nginx | awk '{if ($8 ~/nginx/) print $0}'
kill -9 20719(旧master进程)
启动nginx
1
/usr/local/OpenResty1.17/bin/openresty -c /usr/local/OpenResty1.17/nginx/conf/nginx.conf
本文由作者按照
CC BY 4.0
进行授权