From a648f8a838c1b5b1dd45cbd2b8bc849296ebf48a Mon Sep 17 00:00:00 2001 From: Kevin Michel Date: Wed, 29 Jan 2020 17:03:24 +0100 Subject: [PATCH] Document how environment variables impact configuration --- docs/source/configure.rst | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/source/configure.rst b/docs/source/configure.rst index df5cbe2e..370f7070 100644 --- a/docs/source/configure.rst +++ b/docs/source/configure.rst @@ -4,23 +4,35 @@ Configuration Overview ====================== -Gunicorn pulls configuration information from three distinct places. +Gunicorn reads configuration information from five places. -The first place that Gunicorn will read configuration from is the framework +Gunicorn first reads environment variables for some +configuration :ref:`settings `. + +Gunicorn will then read configuration from a framework specific configuration file. Currently this only affects Paster applications. -The second source of configuration information is a configuration file that is -optionally specified on the command line. Anything specified in the Gunicorn -config file will override any framework specific settings. +The third source of configuration information is a configuration file that is +optionally specified using command line arguments. Anything specified in the +Gunicorn config file will override any framework specific settings. + +The fourth place of configuration information are command line arguments +stored in an environment variable named ``GUNICORN_CMD_ARGS``. Lastly, the command line arguments used to invoke Gunicorn are the final place considered for configuration settings. If an option is specified on the command line, this is the value that will be used. +When a configuration file is specified in the command line arguments and in the +``GUNICORN_CMD_ARGS`` environment variable, only the configuration +file specified on the command line is used. + Once again, in order of least to most authoritative: - 1. Framework Settings - 2. Configuration File - 3. Command Line + 1. Environment Variables + 2. Framework Settings + 3. Configuration File + 4. ``GUNICORN_CMD_ARGS`` + 5. Command Line .. note::