<div dir="ltr"><span style="font-size:12.8px">Hi guys,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I have the following tcp server block in my nginx.conf</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>stream {</div><div>    upstream kafka_producer {</div><div><br></div><div>        server kafka.service.consul:9092;</div><div>    }</div><div><br></div><div>    server {</div><div>        listen 9092;</div><div>        server_name <a href="http://kafka.stream.mycompany.com/" target="_blank">kafka.stream.mycompany.com</a>;</div><div>        proxy_connect_timeout 10s;</div><div>        proxy_timeout 30s;</div><div>        proxy_pass kafka_producer;</div><div>    }</div><div>}</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I would like that my kafka tcp stream is accessible using only the <a href="http://kafka.stream.mycompany.com:9092/" target="_blank">kafka.stream.mycompany.com:9092</a> address....just in the same way that it works with http server blocks.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">However I get the following error regarding the server_name:  </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><b>"server_name" directive is not allowed here in /etc/nginx/nginx.conf</b><br></div><div style="font-size:12.8px"><b><br></b></div><div style="font-size:12.8px">So who knows how I can simulate server_name within tcp server blocks?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks!</div></div>