目前设置如下:
stream {
server {
listen 9987 udp;
server_name subdomain.EXAMPLE.com; # this line is resulting in an error
proxy_pass localhost:9987;
proxy_timeout 1s;
proxy_responses 1;
error_log logs/dns.log;
}
}
服务器名称子域名.EXAMPLE.com;
这可能吗?
$nginx -t
$nginx: [emerg] "server_name" directive is not allowed here in /etc/nginx/nginx.conf:15
没有 server_name 也可以正常工作,但如果可能的话我想使用子域。 (我正在使用一个构建--带流,那不是我的问题。)
TCP 没有服务器名称的概念,因此这是不可能的。它只起作用
在 HTTP 中,因为客户端发送它尝试访问的主机名
请求的一部分,允许 nginx 将其匹配到特定的服务器块。
Source: https://forum.nginx.org/read.php?2,263208,263217#msg-263217 https://forum.nginx.org/read.php?2,263208,263217#msg-263217
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)