TCP load balancing with domain name

aRaviNd ambadiaravind at
Thu Jun 21 08:35:57 UTC 2018

Hi All,

I am trying to configure tcp load balancing with Nginx with below

stream {
    server {
        listen 25;
        proxy_pass $host:25;

If I try to connect i would like to expand my variable $host to and internally it will resolve to servers who handles mail for
that mx record.

Please let me know is there any nginx variable in stream which supports
hostname i am connecting.

Aravind M D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list