Nginx reverse proxy has data duplicate insertion problems due to proxy_next_upstream
Environment: Nginx is used for load balancing in front, followed by 2 Web servers
Reason: the system often appears to give users multiple settlement benefits.
Reason: due to the slow processing during the peak time of the settlement system and the long processing time at the time of settlement, it has exceeded the
Proxy_connect_timeout 30
Proxy_send_timeout 30
Proxy_read_timeout 60
Three times, and at the same time set
Proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_404; ensures high availability of the server
The upstream timed out and went to the next web server to handle it, but the previous process was still running, so it was settled many times.
Deal with:
1. Set proxy_next_upstream to off for partially settled interfaces
two。 Other interfaces are still set to proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_404; to ensure the high availability of the server