nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16

最近在编译运行nginx是报错:nginx: [emerg] unknown directive “rtmp” in ./…/conf/nginx.conf:16
,看着是nginx不认识rtmp,缺少rtmp模块。需要重新编译安装nginx。

以下为解决步骤:

  • wget https://github.com/arut/nginx-rtmp-module/archive/master.zip //下载rtmp模块
  • unzip master.zip (确保master.zip 和 nginx-1.20.2.tar.gz在同一目录下)
  • tar -zxvf nginx-1.20.2.tar.gz
  • cd nginx-1.20.2
  • ./configure --with-http_ssl_module --add-module=…/nginx-rtmp-module-master
  • make
  • sudo make install

参考:https://stackoverflow.com/questions/37442819/unknown-directive-rtmp-in-etc-nginx-nginx-conf76

c++修改于20221013

你可能感兴趣的:(nginx)