I am trying to implement "ssl_preread" in my nginx. My nginx is compiled with "--with-stream_ssl_preread_module" this module.
I mentioned "ssl_preread on;" in server directive of nginx.conf. But i am getting below error.
nginx: [emerg] "ssl_preread" directive is not allowed here in /opt/nginx/conf/nginx.conf:43
I am following below doc.
http://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html
--with-stream
--with-stream_ssl_preread_module
stream { upstream app { server IP1:Port; server IP2:Port; } map $ssl_preread_server_name $upstream { default app; } server { listen PORT; ssl_preread on; proxy_pass $upstream; } }
This worked for me. Let me know if this works for you too