[emerg] "stream" directive is not allowed 怎么解哈,已经安装了模块

34次阅读

共计 1200 个字符,预计需要花费 3 分钟才能阅读完成。

安装的是 OneinStack 在 nginx.conf 插入 stream 代码的时候报错,显示的是 "nginx: [emerg] "stream" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:86"stream {    map $ssl_preread_server_name $backend_name {        test.domain.net trojan;        test1.domain.net web;        test2.domain.net web;   }    upstream trojan {        server 127.0.0.1:50443;   }    upstream web {        server 127.0.0.1:445;   }    server {        listen 443 reuseport;        listen [::]:443 reuseport;        proxy_pass  $backend_name;        ssl_preread on;    }} 复制代码网上普遍反应是没有安装模块,但似乎是装了的哈 Nginx version: nginx/1.22.1built by gcc 8.3.0 (Debian 8.3.0-6)built with OpenSSL 1.1.1s  1 Nov 2022TLS SNI support enabledconfigure arguments: –prefix=/usr/local/nginx –user=www –group=www –with-http_stub_status_module –with-http_sub_module –with-http_v2_module –with-http_ssl_module –with-stream –with-stream_ssl_preread_module –with-stream_ssl_module –with-http_gzip_static_module –with-http_realip_module –with-http_flv_module –with-http_mp4_module –with-openssl=../openssl-1.1.1s –with-pcre=../pcre-8.45 –with-pcre-jit –with-ld-opt=-ljemalloc 复制代码感谢 gaoji.me 2022-12-21 11:16 2stream 要放在 http 之外,和 http 同级 emzz 2022-12-21 11:47 3 重装系统,然后用宝塔装 Nginx 解决,楼主应该是 CentOS,用 yum 装的 Nginx ceplavia 2022-12-21 11:57 43 楼说的什么屁东西,什么都宝塔。.。你 stream 块放错位置了

正文完
 0