2

We have a GCE project, with several servers behind a loadbalancer. The servers are running a NodeJS HTTPS server. We have recently tried to implement websocket support, but can't seem to connect to it from behind the loadbalancer. As soon as the upgrade header gets sent to the server to initiate the websocket, it closes the connection with a 400 error.

In the loadbalancer's logs we see the following:

  @type:  "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry"   
  statusDetails:  "upgrade_header_rejected"   

The connection doesn't seem to go through to our backend servers. Does anyone know how to solve this?

Nils Eijk
  • 21
  • 2
  • 1
    The error can be caused by a load balancer configuration incompatibility. maybe you should change the type of load balancing used. – Overmind Apr 23 '19 at 11:09

1 Answers1

1

WebSocket is natively supported by the HTTP(s) load balancers in GCP. If you are using that load balancer and you are receiving the “upgrade_header_rejected” message is probably because the backend rejected the connection. It is also possible that the client tried to upgrade from a secure connection to an insecure one or that the header is an invalid one.

Marco
  • 31
  • 3