I'm using Nginx as a load balancer between two webservers.
I noticed that, when one of the two webservers is down, GET requests are well forwarded to the second one, while POST are not:
Here is the message I got with GET request, it is forwarded to the second server, and end with a proper 200:
"xx.xx.xx.xx" 502 na.mysite.net [...] "server-01:443, server-02:443" [...] 502, 200
Here is the message I got with POST request, it ends with a 502:
"xx.xx.xx.xx" 502 na.mysite.net [...] "server-01:443" [...] 502
The upstream servers are defined that way:
upstream my-site{
keepalive 16;
# Web backend servers
server server-01:443 max_fails=0;
server server-02:443 max_fails=0;
}
Before you ask, I don't use max_fails nor fail_timeout because some requests can take a very, very long time (minutes) so I don't want them to be considerate as failed.
I would like to have the same behavior for POST requests, but I can't find information regarding this on Google or Nginx's documentation.
Any help is welcomed, thank you in advance!