From 917ebcdd5701e0859a3c250fbf2f0e80233b3fe5 Mon Sep 17 00:00:00 2001 From: Jack Zhang Date: Thu, 25 Mar 2021 22:31:58 +0800 Subject: [PATCH 1/2] Fixes #1695 --- docs/source/deploy.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/deploy.rst b/docs/source/deploy.rst index 43bad9a8..ff78575d 100644 --- a/docs/source/deploy.rst +++ b/docs/source/deploy.rst @@ -38,6 +38,22 @@ To turn off buffering, you only need to add ``proxy_buffering off;`` to your } ... +If you want to ignore aborted requests like health check of Load Balancer, some +of which close the connection without waiting for a response, you need to turn +on ignoring client abort. + +To ignore aborted requests, you only need to add +``proxy_ignore_client_abort on;`` to your ``location`` block:: + + ... + proxy_ignore_client_abort on; + ... + +.. note:: + The default value of ``proxy_ignore_client_abort`` is ``off``. Error code + 499 may appear in Nginx log and ``Ignoring EPIPE`` may appear in Gunicorn + log if loglevel is set to ``debug``. + It is recommended to pass protocol information to Gunicorn. Many web frameworks use this information to generate URLs. Without this information, the application may mistakenly generate 'http' URLs in From 90ef9a6a9407fcf602da769a950b5e984fa9d025 Mon Sep 17 00:00:00 2001 From: Jack Zhang Date: Thu, 10 Jun 2021 10:40:13 +0800 Subject: [PATCH 2/2] Add nginx documentation for proxy_ignore_client_abort --- docs/source/deploy.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/deploy.rst b/docs/source/deploy.rst index ff78575d..f9676616 100644 --- a/docs/source/deploy.rst +++ b/docs/source/deploy.rst @@ -40,7 +40,7 @@ To turn off buffering, you only need to add ``proxy_buffering off;`` to your If you want to ignore aborted requests like health check of Load Balancer, some of which close the connection without waiting for a response, you need to turn -on ignoring client abort. +on `ignoring client abort`_. To ignore aborted requests, you only need to add ``proxy_ignore_client_abort on;`` to your ``location`` block:: @@ -373,3 +373,4 @@ utility:: .. _Virtualenv: https://pypi.python.org/pypi/virtualenv .. _Systemd: https://www.freedesktop.org/wiki/Software/systemd/ .. _Gaffer: https://gaffer.readthedocs.io/ +.. _`ignoring client abort`: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort