1
votes

My server side setup is like this : I have a google compute engine instance running nodejs server. It sits behind https load balancer.

So the issue is that if OPTIONS type request is sent with body(payload) to load balancer ip, it sometimes fail with 502. I have checked that in all these requests, node server is returning and logging correct responses. It works perfect if the request body is left empty.

However, when I directly hit GCE's ip, it works fine whether or not request body is there or not.

For e.g this is the load balancer ip (with ssl enabled)

OPTIONS https://130.211.14.60/health

this is the direct GCE machine ip (without ssl)

OPTIONS http://104.199.159.212:8002/health

I have checked by sending requests multiple times(literally hundreds of times) using Postman app.

And this issue is only with DELETE and OPTIONS type requests. GET/POST/PUT works perfectly fine.

Is there anyone who can point me what the issue could be and how to solve it.

2

2 Answers

2
votes

From Google's docs -

The HTTP(S) load balancer does not support sending an HTTP DELETE with a body to the load balancer. Such requests will receive an error message: Error 400 (Bad Request)!! Your client has issued a malformed or illegal request. Only DELETE requests without bodies are supported.

More info here.

1
votes

This feature is now supported by Google Load Balancer, released in Dec '18.

More info here.