Welcome! Log In Create A New Profile

Advanced

Nginx converts 409 from upstream to 502

December 21, 2019 07:49AM
Hi,

Our request flow looks like this:

client --> nginx --> haproxy --> tomcat

Put requests with large bodies are used to upload files. Sometimes due to some application logic, tomcat may reject an upload early and return 409, tomcat does not drain the input stream, we do not want to read the input stream and rather reject early.

When tomcat rejects a PUT request early with 409, tomcat access logs show 409. The haproxy fronting tomcats also log a 409 in access logs, but nginx logs a 502 and sends a 502 to the clients. It looks like nginx does not like that request is rejected and a 409 is sent without reading the full request by the upstream.

What can we do to make sure client receives the correct response code i.e. 409

Thanks
Sachin
Subject Author Posted

Nginx converts 409 from upstream to 502

sachin.shetty@gmail.com December 21, 2019 07:49AM

Re: Nginx converts 409 from upstream to 502

Maxim Dounin December 22, 2019 01:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 170
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready