执行nginx -t 提示nginx配置文件中不允许使用“stream”指令?

root@wsy-message4 sbin]# ./nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/etc/nginx --sbin-path=/usr/etc/nginx/sbin/nginx--error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=wssuser --group=wssuser --with-http_ssl_module --with-threads --with-http_realip_module --with-http_gzip_static_module --http-proxy-temp-path=/var/tmp/nginx/proxy/ --with-http_stub_status_module --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --add-module=../nginx_upstream_check_module-master --with-pcre --with-stream
[root@wsy-message4 sbin]# nginx -t
nginx: [emerg] "stream" directive is not allowed here in /usr/etc/nginx/conf/conf.d/ab_pay_gateway.conf:26
nginx: configuration file /usr/etc/nginx/conf/nginx.conf test failed

配置文件格式:
stream{
upstream rabbitTcp{
server 172.16.15.17:5672;
server 172.16.15.18:5672;
}

server {
    listen 8080;
   
    location /rbweb/{ 
 proxy_pass rabbitTcp;
 }

}
}

img

你这个是tcp协议代理,默认你这个版本里应该不是这样写的。你可以搜下nginx tcp_proxy,有相应的module和文档。

有点着急,江湖救急

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答

本次提问扣除的有问必答次数,已经为您补发到账户,我们后续会持续优化,扩大我们的服务范围,为您带来更好地服务。