nginx 动态添加模块

  • 需要用到nginx的tcp模块,以前安装的nginx没有这个模块。
nginx 动态添加模块_第1张图片
./nginx -V 可以看到所有包含的模块(我这边实际上已经安装了stream模块)
  • 重新编译nginx找到上图中的 configure arguments + --with-stream


    nginx 动态添加模块_第2张图片
    ./configure --with-http_ssl_module --with-http_v2_module --with-stream
  • make一下,不要make install 会覆盖安装


    nginx 动态添加模块_第3张图片
    make
  • 备份老的可执行文件,替换新的可执行文件


    cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

    cp ./objs/nginx /usr/local/nginx/sbin/
  • 启动nginx


    nginx 动态添加模块_第4张图片
    ./nginx

你可能感兴趣的:(nginx 动态添加模块)