My app runs with nginx and uwsgi (python). My aim is to drop a connection (as explained here) e.g. when the python app decides to do so.
Is there a nginx parameter to \"
It turns out the answer is simpler than I thought - use the uwsgi_intercept_errors directive.
Firstly, from the upstream app (in my case python) return 444
.
Secondly, configure nginx as follows:
location / {
uwsgi_pass myapp;
include uwsgi_params;
[...]
uwsgi_intercept_errors on;
error_page 444 @drop;
}
location @drop {
return 444;
}