opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
832 stars 618 forks source link

www/nginx - Support gRPC proxy in nginx #4076

Open benniekiss opened 2 months ago

benniekiss commented 2 months ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe. Netbird, a mesh-vpn service, requires gRPC support. The current nginx plugin does not support configuring grpc proxying via the GUI.

Describe the solution you'd like Allow proxying gRPC connections via GUI in the nginx plugin.

Describe alternatives you've considered Caddy offers grpc support; however, I have several services currently setup through nginx, and I rely on the streams module for some of those services. Likewise, caddy does not offer a GUI option to configure the bind address, which I also rely on in nginx due to some segmented network patterns.

fabianfrz commented 1 month ago

This looks like a huge change to the template code to implement grpc as this seems to be a custom upstream module, where all the directives have custom names:

http://nginx.org/en/docs/http/ngx_http_grpc_module.html

I also don't think that this is currently compiled in.

benniekiss commented 1 month ago

I'm able to get the gRPC proxy working using the _post hook, so it should already be built in.

If you'd be willing to accept a PR, I'll take a look through the code and see if I can come up with a solution. I was thinking something along the lines of a toggle button under the Location settings, which when enabled, would add the gRPC proxy config for that location. The options generally seem to mimic the http config options, so many of the settings could be inherited from that.