proxy_ignore_client_abort

Configures whether to ignore client aborts while processing proxy requests. — NGINX HTTP Core

proxy_ignore_client_abort
httpserverlocation
Синтаксисproxy_ignore_client_abort on | off;
По умолчаниюoff
Контекстhttp, server, location
МодульNGINX HTTP Core
Аргументыflag

Описание

The `proxy_ignore_client_abort` directive controls how NGINX handles scenarios where a client disconnects before the server has completed processing the request. When set to 'on', NGINX will continue to process the request as if the client is still connected, potentially allowing server-side processing to complete without interruption. This can be useful in environments where long-running operations on the server should not be prematurely halted by client actions. Conversely, setting it to 'off' instructs NGINX to stop processing the request if the client disconnects, which can save server resources and prevent unnecessary processing when the client will not receive the response. This directive can be applied within the contexts of `http`, `server`, and `location`, providing flexibility in how it influences request handling across different levels of the configuration hierarchy. Its behavior is influenced by its parameter, which can either be a flag - typically 'on' or 'off'. Users should be mindful of how this setting influences resource usage, especially in high-load scenarios where a large amount of processing may be allocated to incomplete requests.

Пример конфига

server {
    listen 80;
    location /long-processing {
        proxy_pass http://backend;
        proxy_ignore_client_abort on;
    }
}

Setting this directive to 'on' can lead to wasted server resources if many clients disconnect.

Make sure to assess the implications of keeping long processes running in high-load environments.