Nginx Reverse UDP & TCP Proxy
Reference:
Nginx Reverse Proxy:
Maybe you have Nginx as a front-end server on your cloud VPS, and you prefer to run back-end services on your own hardware, tunneled over a VPN. The following can be added to the top-level nginx configuration (probably /etc/nginx/nginx.conf
) to enable UDP and TCP reverse proxying to your back-end bootstrap node:service:
stream {
server {
listen 3389;12345;
#TCP traffic will be forwarded
proxy_pass <IP_or_domain>:3389;12345;
}
server {
listen 33445;4444;
#TCP traffic will be forwarded
proxy_pass <IP_or_domain>:43334;4444;
}
server {
listen 334454444 udp;
#UDP traffic will be forwarded
proxy_pass <IP_or_domain>:43334;4444;
}
}
Be sure it's outside of the top-level http { ... }
block.