首页 > 系统相关 >yum安装nginx报错解决nginx: [emerg] unknown directive “stream“ in /etc/nginx/nginx.conf问题【转】

yum安装nginx报错解决nginx: [emerg] unknown directive “stream“ in /etc/nginx/nginx.conf问题【转】

时间:2022-09-05 09:01:50浏览次数:66  
标签:directive stream etc nginx yum conf 报错

yum安装nginx,其中看nginx有stream参数,但是nginx -t是报错“nginx: [emerg] unknown directive “stream“ in /etc/nginx/nginx.conf问题”

 

 解决办法

# 安装nginx源
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 先安装
yum -y install epel-release

#应该是缺少modules模块
yum -y install nginx-all-modules.noarch
然后在用nginx -t就好了
[root@k8s-node2 ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

转自

(40条消息) 解决nginx: [emerg] unknown directive “stream“ in /etc/nginx/nginx.conf问题_一个不专业的码农的博客-CSDN博客
https://blog.csdn.net/weixin_45858439/article/details/122215639

 

标签:directive,stream,etc,nginx,yum,conf,报错
From: https://www.cnblogs.com/paul8339/p/16656847.html

相关文章