Same! I'm trying to reverse proxy a bedrock server (through nginx):
stream {
server {
listen 19132 udp;
proxy_pass <EXTERNAL_IP>:19132;
}
}
And I'm getting: "Unable to connect to world.".
I wish there are more logs available on the client side :/
I finally found out the solution to nginx reverse proxying a bedrock server! Since Bedrock servers run on RakNet, the session across the proxy must be kept. If you look at http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html, you'll see that normally, every request becomes a new session. You don't want this. For the solution to work, you'll need to have NGINX version 1.15.7 and up (http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_requests)! Looking at the documentation for RakNet, in the worst case scenario, packets are sent every 10 milliseconds, eg 100 packets/requests are sent in 1 second (1000 milliseconds in 1 second). This means, that in order to keep the same session between the client and the user for one day, you'll need to hold a session for 8640000 packets/requests (100 packets/sec * 60 sec/min * 60 min/hr * 24 hr/day) (for one week, you'll need to accept 60480000 packets).
If you look at nginx's documentation on "proxy_requests":
Sets the number of client datagrams at which binding between a client and existing UDP stream session is dropped. After receiving the specified number of datagrams, next datagram from the same client starts a new session. The session terminates when all client datagrams are transmitted to a proxied server and the expected number of responses is received, or when it reaches a timeout.
This means that you need to accept 8640000 datagrams for a session that lasts 1 day (the duration of the user staying in the game within a single session before they forcibly disconnect). In other words, the configuration of NGINX should be:
With a load balancer:
Obviously, if you want to change the session time, just change proxy_requests. Remember that all communication is over UDP and that you need at least NGINX 1.15.7 for this to work. Cheers!