From a47c5bfc6535dca3e83f182ccfe03c2b87979b4a Mon Sep 17 00:00:00 2001 From: Kartik Ohri Date: Wed, 22 Nov 2023 01:24:11 +0530 Subject: [PATCH] Fix uWSGI configuration for clean shutdown As per investigation, we can remove exit-on-reload and use the array form of the command to ensure proper signal handling on reloads. --- docker/prod/consul-template-redirect.conf | 2 +- docker/prod/uwsgi.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/prod/consul-template-redirect.conf b/docker/prod/consul-template-redirect.conf index 6229861..8e80714 100644 --- a/docker/prod/consul-template-redirect.conf +++ b/docker/prod/consul-template-redirect.conf @@ -5,7 +5,7 @@ template { } exec { - command = "chpst -u art:art /home/art/.local/bin/uwsgi /etc/uwsgi/uwsgi.ini" + command = ["chpst", "-u", "art:art", "/home/art/.local/bin/uwsgi", "/etc/uwsgi/uwsgi.ini"] splay = "10s" reload_signal = "SIGHUP" kill_signal = "SIGTERM" diff --git a/docker/prod/uwsgi.ini b/docker/prod/uwsgi.ini index 46a4767..765d85e 100644 --- a/docker/prod/uwsgi.ini +++ b/docker/prod/uwsgi.ini @@ -9,3 +9,6 @@ processes = 10 die-on-term = true worker-reload-mercy = 10 reload-mercy = 25 +log-x-forwarded-for=true +; quit uwsgi if the python app fails to load +need-app = true