01. Fixing mirror delays while using mirroring option in Nginx.

Taken from here:

Hi, I'm using the mirror module in my "production" nginx in order to mirror real traffic to a test envrionment. I don't want this mirroring to affect the latency of the production environment, but it looks like the nginx is waiting for the response from the test environment. is there a way to avoid this? I just want the request to get to the test environment and let it process it. but it shouldn't wait fo r the response from the test environment in order to respond to the request

The solution is to set keepalive_timeout to 0 in primary location ( if this is affordable by your app ):