Hi Ottavio<div><br></div><div>There’s no solution just with nginx as it currently that I know of, to avoid the need for a port forward in the NAT router a simple solution would be to use a ssh tunnel - this does separate initial connection from subsequent requests as you’re unlikely to want to establish a new tunnel for each and every request and ‘knowledge’ the connection is established is no longer inherently part of the application making the HHTP request. So to simplify things you could just expect the ssh tunnel to be established as a precondition (once off initial setup)</div><div><br></div><div>Phillip<br><br>On Friday, August 27, 2021, Maxim Dounin <<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
On Fri, Aug 27, 2021 at 01:59:03PM +0200, Ottavio Campana wrote:<br>
<br>
> Dear Phillip,<br>
> <br>
> I know Tailscale very well, I use it and like it a lot. But my final goal<br>
> is finding a way to implement the ONVIF Uplink service,<br>
> <a href="https://www.onvif.org/specs/srv/uplink/ONVIF-Uplink-Spec.pdf" target="_blank">https://www.onvif.org/specs/sr<wbr>v/uplink/ONVIF-Uplink-Spec.pdf</a> , where I can<br>
> have several devices on the LAN that need to connect to a remote server,<br>
> which will then send commands.<br>
> <br>
> Therefore I need a way to start a connection from nginx (or an external<br>
> program and then passing the fd through a unix socket domain) and make it<br>
> act as if the fd were obtained from an accept.<br>
> <br>
> Nginx works with events and I find it very difficult to find a mechanism to<br>
> pass this connection to it.<br>
> <br>
> Do you have other ideas?<br>
<br>
The most simple solution I can think of is to open two <br>
connections: to your command endpoint and to nginx, and proxy <br>
everything once the connections are established.<br>
<br>
-- <br>
Maxim Dounin<br>
<a href="http://mdounin.ru/" target="_blank">http://mdounin.ru/</a><br>
______________________________<wbr>_________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx-devel</a><br>
</blockquote></div>