nginx: [emerg] unknown directive “stream“ in /etc/nginx/nginx.conf

米斯特程序猿 2023年02月15日 290次浏览

问题原因是默认安装的 nginx 没有安装 stream 支持

# 重新安装 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

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful