Welcome! Log In Create A New Profile

Advanced

What is the best way to add a socket to nginx web server?

Ottavio Campana
March 23, 2017 08:06AM
Hello everybody,

I am trying to understand if I can use/change nginx to solve a problem related to a very particular scenario

I have this scenario:

nginx web server <--> router with NAT <--> client running with a public IP address

I cannot configure NAT on the router, so setting port forwarding is not an option.

My idea is to have a small program that starts a TCP connection towards the client and that passes the socket descriptor to the nginx web server.

Basically the whole procedure can be summarized as follows:
1) the helper program, running on the same host of nginx, starts the TCP connection and punch holes the NAT
2) the client accepts the connection
3) the helper program passes the socket descriptor to the nginx web server by using a AF_UNIX socket
4) nginx receives the socket and adds this socket to it set of sockets
5) the client can now start sending HTTP requests to the webserver, as normally

So, the question is: is there a preferred/already existing solution/infrastructure in nginx to do this?

Thank you

Ottavio
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

What is the best way to add a socket to nginx web server?

Ottavio Campana 421 March 23, 2017 08:06AM

Re:What is the best way to add a socket to nginx web server?

胡聪 (hucc) 212 March 23, 2017 08:48AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready