一个专业运
维技术分享!

用yum安装的nginx,报unknown directive “stream”

用yum安装的nginx,报unknown directive “stream”

解决方法:yum install nginx-mod-stream -y

[root@localhost modules]# yum install nginx-mod-stream -y

已安装:
  nginx-mod-stream.x86_64 1:1.20.1-2.el7                                                                                 

安装位置

[root@localhost ~]# ll /usr/lib64/nginx/modules
总用量 176
-rwxr-xr-x 1 root root 179864 6月   2 08:24 ngx_stream_module.so

nginx配置文件引入stream模块

[root@localhost ~]# cat /etc/nginx/nginx.conf
# 加载stream模块
load_module /usr/lib64/nginx/modules/ngx_stream_module.so;
user  nginx;
worker_processes  auto;
...

nginx新版本已经不需要load

[root@localhost ~]# vim /etc/nginx/nginx.conf
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# nginx -t
nginx: [emerg] unknown directive "ELF" in /usr/lib64/nginx/modules/ngx_stream_module.so:4
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@localhost ~]# 
[root@localhost ~]# vim /etc/nginx/nginx.conf
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# nginx -t
nginx: [emerg] module "ngx_stream_module" is already loaded in /usr/share/nginx/modules/mod-stream.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@localhost ~]# 
[root@localhost ~]# nginx -v
nginx version: nginx/1.20.1


微信扫描下方的二维码阅读本文

赞(1) 打赏
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。小柳实验室 » 用yum安装的nginx,报unknown directive “stream”

相关推荐

  • 暂无文章

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏