Welcome! Log In Create A New Profile

Advanced

Re: server_name within tcp server blocks

Richard Stanway
December 02, 2015 01:18PM
TCP has no concept of server names, so this is not possible. It only works
in HTTP because the client sends the hostname it is trying to access as
part of the request, allowing nginx to match it to a specific server block.

On Wed, Dec 2, 2015 at 12:31 PM, Charles Nnamdi Akalugwu <
cprenzberg@gmail.com> wrote:

> 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
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

server_name within tcp server blocks

cprenzberg December 02, 2015 06:32AM

Re: server_name within tcp server blocks

Richard Stanway December 02, 2015 01:18PM

Re: server_name within tcp server blocks

itpp2012 December 02, 2015 01:46PM

Re: server_name within tcp server blocks

cprenzberg December 03, 2015 05:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready