Is it possible to forward NON-http connecting request to some other port in nginx?
It is possible since nginx 1.9.0:
http://nginx.org/en/docs/stream/ngx_stream_core_module.html
Something along these lines (this goes on top level of nginx.conf
):
stream { upstream backend { server backend1.example.com:12345; } server { listen 12345; proxy_pass backend; }}
This is technically possible for sure.
You can modify open source tcp proxies like nginx module called nginx_tcp_proxy_module or HAproxy.
Or you can write a nginx module similar to above one to do this for you.