Using nginx for Luci and as stream proxy

I'm trying to configure nginx on my OpenWrt router ( 21.02.1 on x86 hardware) with the intent of using it both for Luci and, with ngx_stream_ssl_module, configure hostname based TLS passthrough to a few backend servers.

I have a couple of questions related to getting this setup:

  1. Can anyone confirm if the ngx_stream_ssl_module is included in the OpenWrt build? I have version1.19.6-2.

  2. Assuming it is included, I need to reconfigure the default listener for Luci to bind to the local, internal IP only. I know how to make the configuration change in nginx, but it's unclear to me where to make the change.

I count three options?

  1. Using uci to make the change
  2. Modifying /etc/config/nginx
  3. Modifying /etc/nginx/uci.conf

With a bit more reading, and reading between the lines, I've figured out that the best way is to modify /etc/config/nginx which will dynamically update /etc/nginx/uci.conf. I tried adding a config file in /etc/nginx/conf.d for my stream proxy, but nginx doesn't like the file. Running a test on the file reveals that nginx doesn't recognize the stream directive, so the module appears to be missing.

ThanX!

Turns out, I needed to install the nginx-all-module package to get the required module. When I get this working, I'll have to document the complete process.

mee too having troubles with stream option