Kuray Karaaslan
Kuray Karaaslan

Reputation: 1

Reverse Proxying Multiple Stream with same port using Ngnix on NAT

I have two LXD containers running on my server, each with its own OpenVPN server listening on port 1194 UDP. Here are the details:

Container A: IP address 10.117.93.53 Container B: IP address 10.117.93.231

On my server, I’m running Ubuntu 24.04 and have Nginx configured as a reverse proxy but I’m having trouble configuring it for UDP streams.

I recently learned that starting with version 1.25.1, Nginx supports server_name in the stream module. Here is my current configuration:

stream {
 server {
     listen 1194 udp;
     server_name container-a.my-server.xyz;
     proxy_pass 10.117.93.53:1194;
 }

 server {
     listen 1194 udp;
     server_name container-b.my-server.xyz;
     proxy_pass 10.117.93.231:1194;
 }
}

The problem is that I can only connect to one of the containers at a time. To connect to the other container, I have to remove the configuration for the first one. How can I configure Nginx so that I can connect to both containers simultaneously based on the server_name?

Thank you for your help!

When i connect to other server, it gives error

Server poll timeout, tyring next remote entry

Upvotes: 0

Views: 50

Answers (0)

Related Questions