Nginx as forward proxy for secure LDAP

Modify /etc/nginx/nginx.conf file by adding a new stream section, for example:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections 1024;
}

stream {
    #SSL cert, standart port
    server {
        listen 636 ssl;
        ssl_certificate /opt/ssl/public.key;
        ssl_certificate_key /opt/ssl/private.key;
        proxy_pass 192.168.0.100:389;
    }

    #SSL cert, not standart port
    server {
        listen 637 ssl;
        ssl_certificate /home/user/ssl/public.key;
        ssl_certificate_key /home/user/ssl/private.key;
        proxy_pass 192.168.0.100:389;
    }

    #without SSL cert, not standart port
    server {
        listen 390;
        proxy_pass 192.168.0.100:389;
    }
}