Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

doesn't want to work with nginx for some reason

Open lootoos opened this issue 2 years ago • 6 comments

Describe the bug

I am using nginx in the HAProxy role: https://ibb.co/FnpFhPk minecraft java is working, but Geyser for some reason does not want to let in - an attempt to log in to Geyser is not even visible. Geyser doesn't support Nginx yet-what? If so, why and will it be supported? My geyser config: https://pastebin.com/MgBDS424

To Reproduce

  1. Enable in geyser config.yml:enable-proxy-protocol: true
  2. Configure nginx as a HAProxy
  3. Trying to log in to the server

Expected behaviour

It is expected that there will be an attempt to log into Geyser packages, but for some reason, an attempt to log in to the player is not visible in the geyser logs.

Screenshots / Videos

https://ibb.co/FnpFhPk

Server Version and Plugins

kernel:mirai 1.19.2.

Geyser Dump

No response

Geyser Version

Build #1174 (https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/master/1174/)

Minecraft: Bedrock Edition Device/Version

No response

Additional Context

No response

lootoos avatar Aug 11 '22 02:08 lootoos

Does setting bedrock address to 0.0.0.0 resolve the issue?

Camotoy avatar Aug 11 '22 02:08 Camotoy

I suspect something else is up because while we don't actively test the feature, TCPShield uses it and if this broke we would know. Is 19135 UDP correctly exempted on the firewall on the computer hosting Geyser?

Camotoy avatar Aug 11 '22 02:08 Camotoy

with such settings, an attempt to log into the server is visible, but because Nginx uses proxy_protocol on; then the server geyser cannot accept packets

That looks like a completely separate issue where you need to set remote address to point to Nginx and not localhost (which is what auto defaults to). If you're getting connection logs by disabling Bedrock proxy protocol, then you're probably connecting to the wrong server.

Camotoy avatar Aug 11 '22 02:08 Camotoy

Actually it sounds like this is all localhost, so set remote port to 25565.

Camotoy avatar Aug 11 '22 02:08 Camotoy

By white IP do you mean static, and by gray IP do you mean dynamic?

Konicai avatar Aug 13 '22 23:08 Konicai

I have this issue too. My Bedrock client can see the server but won't connect to it when using Nginx. I'm running Geyser as a plugin on one server and the Nginx proxy on other server. Both firewalls have UDP 19132 port open.

This is my config: https://pastebin.com/GwnDv6sb

Also nginx config: stream { server { listen 19132 udp; proxy_pass MCServerWithGeyserIP:19132; proxy_protocol on; } }

mbenitog avatar Aug 28 '22 20:08 mbenitog

I have the same issue.

nginx config:

upstream bungeecord{ server 192.168.0.199:19132; } server { listen 19132 udp reuseport; proxy_pass bungeecord; }

darallium avatar May 24 '23 14:05 darallium

Pings work and the MOTD shows, but connections end up failing. It just keeps saying "[IP] tried to connect!"

darallium avatar May 24 '23 14:05 darallium

@darallium please send a Geyser dump by running "geyser dump" and sending the link it'll give you here.

onebeastchris avatar May 24 '23 15:05 onebeastchris

https://dump.geysermc.org/TQY4ZHUyzYUfikqO7Io8jYpzXcHOrtP8

darallium avatar May 25 '23 08:05 darallium

I think nginx cannot udp forward ipv4 and ipv6 at the same time and, Geyser cannot receive udp connection with ipv4 and ipv6 at the same time.

darallium avatar May 25 '23 08:05 darallium

did anyone find a solution please?

fileexists avatar Aug 23 '23 01:08 fileexists

Geyser cannot receive udp connection with ipv4 and ipv6 at the same time.

Solution 1.Remove ipv6 from A record

1.Set up two Geysers and force one only able to listen to ipv6, and either.

darallium avatar Aug 23 '23 01:08 darallium

im currently using envoyproxy and i can connect successfully but on my bungeecord console i get a protobuf error, and my ip is the one of the machine where the envoyproxy is hosted, is there any solution to this? I want to forward the real user IP and fix the protobuf error

fileexists avatar Aug 23 '23 09:08 fileexists

Closing this, as it's likely a configuration issue - and not a direct Geyser bug/issue. Simultaneous ipv6 and ipv4 binding is an unrelated feature request, tracked here: https://github.com/GeyserMC/Geyser/issues/3547.

onebeastchris avatar Nov 14 '23 15:11 onebeastchris

I have never seen this feature working. I asked several users on some Discord servers and we all have the same issue. Pings work and the MOTD shows, but connections end up failing.

Nginx configuration is pretty simple and straightforward, it is also a thoroughly tested piece of software. It was previously mentioned that this Geyser feature is not tested.

I wouldn’t disregard this as a Geyser issue

mbenitog avatar Nov 14 '23 20:11 mbenitog

It is an indisputable fact that Gayser cannot accept IPV6 and IPV4 at the same time. I will offer a temporary solution, but I strongly hope that the problem will be fixed.

Temporary Solution:.

  1. set up two front-end proxy servers such as BungeeCord or Waterfall.
  2. Bind one to listen to IPV4 and one to listen to IPV6 only.
  3. Set up a reverse proxy server such as nginx before the first proxy server.
  4. determine whether the IP is ipv4 or ipv6 by looking at the IP, and distribute the IP to each proxy server.
  5. Set up the proxy servers in the first step so that they are allocated to the same server.

darallium avatar Feb 09 '24 16:02 darallium

This config will work:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

stream {
    upstream balancer {
        server 172.18.0.1:19132;
    }
    server {
        listen 10.0.0.208:19132 udp;
        proxy_requests 8640000;
        proxy_protocol on;
        proxy_timeout 5s;
        proxy_responses 0;
        proxy_pass balancer;
    }
}

If you do not wish to use proxy protocol that can be commented out. proxy_timeout 5s; may need to be adjusted as this is how long it will take for nginx to truly close the connection if it doesn't get a response from the client.

Kas-tle avatar Apr 01 '24 02:04 Kas-tle