Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

server_name within tcp server blocks (2 replies)

$
0
0
Hi guys,

I have the following tcp server block in my nginx.conf

stream {
upstream kafka_producer {

server kafka.service.consul:9092;
}

server {
listen 9092;
server_name kafka.stream.mycompany.com;
proxy_connect_timeout 10s;
proxy_timeout 30s;
proxy_pass kafka_producer;
}
}

I would like that my kafka tcp stream is accessible using only the
kafka.stream.mycompany.com:9092 address....just in the same way that it
works with http server blocks.

However I get the following error regarding the server_name:

*"server_name" directive is not allowed here in /etc/nginx/nginx.conf*

So who knows how I can simulate server_name within tcp server blocks?

Thanks!
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>