Add links for settings

Conflicts:

	docs/source/settings.rst
This commit is contained in:
Berker Peksag 2017-01-23 07:25:18 +03:00
parent 146a769afa
commit 094c73ba10
2 changed files with 153 additions and 0 deletions

View File

@ -60,6 +60,7 @@ def fmt_setting(s):
cli = ", ".join(s.cli) cli = ", ".join(s.cli)
out = [] out = []
out.append(".. _%s:\n" % s.name.replace("_", "-"))
out.append("%s" % s.name) out.append("%s" % s.name)
out.append("~" * len(s.name)) out.append("~" * len(s.name))
out.append("") out.append("")

View File

@ -22,6 +22,8 @@ for reference on setting at the command line.
Config File Config File
----------- -----------
.. _config:
config config
~~~~~~ ~~~~~~
@ -42,6 +44,8 @@ application specific configuration.
Server Socket Server Socket
------------- -------------
.. _bind:
bind bind
~~~~ ~~~~
@ -60,6 +64,8 @@ Multiple addresses can be bound. ex.::
will bind the `test:app` application on localhost both on ipv6 will bind the `test:app` application on localhost both on ipv6
and ipv4 interfaces. and ipv4 interfaces.
.. _backlog:
backlog backlog
~~~~~~~ ~~~~~~~
@ -78,6 +84,8 @@ Must be a positive integer. Generally set in the 64-2048 range.
Worker Processes Worker Processes
---------------- ----------------
.. _workers:
workers workers
~~~~~~~ ~~~~~~~
@ -93,6 +101,8 @@ application's work load.
By default, the value of the ``WEB_CONCURRENCY`` environment variable. By default, the value of the ``WEB_CONCURRENCY`` environment variable.
If it is not defined, the default is ``1``. If it is not defined, the default is ``1``.
.. _worker-class:
worker_class worker_class
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -120,6 +130,8 @@ This alternative syntax will load the gevent class:
``gunicorn.workers.ggevent.GeventWorker``. Alternatively, the syntax ``gunicorn.workers.ggevent.GeventWorker``. Alternatively, the syntax
can also load the gevent class with ``egg:gunicorn#gevent``. can also load the gevent class with ``egg:gunicorn#gevent``.
.. _threads:
threads threads
~~~~~~~ ~~~~~~~
@ -136,6 +148,8 @@ application's work load.
If it is not defined, the default is ``1``. If it is not defined, the default is ``1``.
.. _worker-connections:
worker_connections worker_connections
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
@ -146,6 +160,8 @@ The maximum number of simultaneous clients.
This setting only affects the Eventlet and Gevent worker types. This setting only affects the Eventlet and Gevent worker types.
.. _max-requests:
max_requests max_requests
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -161,6 +177,8 @@ to help limit the damage of memory leaks.
If this is set to zero (the default) then the automatic worker If this is set to zero (the default) then the automatic worker
restarts are disabled. restarts are disabled.
.. _max-requests-jitter:
max_requests_jitter max_requests_jitter
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
@ -175,6 +193,8 @@ restarts to avoid all workers restarting at the same time.
.. versionadded:: 19.2 .. versionadded:: 19.2
.. _timeout:
timeout timeout
~~~~~~~ ~~~~~~~
@ -188,6 +208,8 @@ you're sure of the repercussions for sync workers. For the non sync
workers it just means that the worker process is still communicating and workers it just means that the worker process is still communicating and
is not tied to the length of time required to handle a single request. is not tied to the length of time required to handle a single request.
.. _graceful-timeout:
graceful_timeout graceful_timeout
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
@ -200,6 +222,8 @@ After receiving a restart signal, workers have this much time to finish
serving requests. Workers still alive after the timeout (starting from serving requests. Workers still alive after the timeout (starting from
the receipt of the restart signal) are force killed. the receipt of the restart signal) are force killed.
.. _keepalive:
keepalive keepalive
~~~~~~~~~ ~~~~~~~~~
@ -213,6 +237,8 @@ Generally set in the 1-5 seconds range.
Security Security
-------- --------
.. _limit-request-line:
limit_request_line limit_request_line
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
@ -232,6 +258,8 @@ from 0 (unlimited) to 8190.
This parameter can be used to prevent any DDOS attack. This parameter can be used to prevent any DDOS attack.
.. _limit-request-fields:
limit_request_fields limit_request_fields
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -245,6 +273,8 @@ prevent DDOS attack. Used with the *limit_request_field_size* it allows
more safety. By default this value is 100 and can't be larger than more safety. By default this value is 100 and can't be larger than
32768. 32768.
.. _limit-request-field-size:
limit_request_field_size limit_request_field_size
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
@ -263,6 +293,8 @@ header field sizes.
Debugging Debugging
--------- ---------
.. _reload:
reload reload
~~~~~~ ~~~~~~
@ -287,6 +319,8 @@ is to attempt inotify with a fallback to FS polling.
Note: In order to use the inotify reloader, you must have the 'inotify' Note: In order to use the inotify reloader, you must have the 'inotify'
package installed. package installed.
.. _spew:
spew spew
~~~~ ~~~~
@ -297,6 +331,8 @@ Install a trace function that spews every line executed by the server.
This is the nuclear option. This is the nuclear option.
.. _check-config:
check_config check_config
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -308,6 +344,8 @@ Check the configuration.
Server Mechanics Server Mechanics
---------------- ----------------
.. _preload-app:
preload_app preload_app
~~~~~~~~~~~ ~~~~~~~~~~~
@ -321,6 +359,8 @@ speed up server boot times. Although, if you defer application loading
to each worker process, you can reload your application code easily by to each worker process, you can reload your application code easily by
restarting workers. restarting workers.
.. _sendfile:
sendfile sendfile
~~~~~~~~ ~~~~~~~~
@ -339,6 +379,8 @@ to enable or disable its usage.
.. versionchanged:: 19.6 .. versionchanged:: 19.6
added support for the ``SENDFILE`` environment variable added support for the ``SENDFILE`` environment variable
.. _chdir:
chdir chdir
~~~~~ ~~~~~
@ -347,6 +389,8 @@ chdir
Chdir to specified directory before apps loading. Chdir to specified directory before apps loading.
.. _daemon:
daemon daemon
~~~~~~ ~~~~~~
@ -358,6 +402,8 @@ Daemonize the Gunicorn process.
Detaches the server from the controlling terminal and enters the Detaches the server from the controlling terminal and enters the
background. background.
.. _raw-env:
raw_env raw_env
~~~~~~~ ~~~~~~~
@ -372,6 +418,8 @@ Pass variables to the execution environment. Ex.::
and test for the foo variable environment in your application. and test for the foo variable environment in your application.
.. _pidfile:
pidfile pidfile
~~~~~~~ ~~~~~~~
@ -382,6 +430,8 @@ A filename to use for the PID file.
If not set, no PID file will be written. If not set, no PID file will be written.
.. _worker-tmp-dir:
worker_tmp_dir worker_tmp_dir
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -400,6 +450,8 @@ If not set, the default temporary directory will be used.
See :ref:`blocking-os-fchmod` for more detailed information See :ref:`blocking-os-fchmod` for more detailed information
and a solution for avoiding this problem. and a solution for avoiding this problem.
.. _user:
user user
~~~~ ~~~~
@ -412,6 +464,8 @@ A valid user id (as an integer) or the name of a user that can be
retrieved with a call to ``pwd.getpwnam(value)`` or ``None`` to not retrieved with a call to ``pwd.getpwnam(value)`` or ``None`` to not
change the worker process user. change the worker process user.
.. _group:
group group
~~~~~ ~~~~~
@ -424,6 +478,8 @@ A valid group id (as an integer) or the name of a user that can be
retrieved with a call to ``pwd.getgrnam(value)`` or ``None`` to not retrieved with a call to ``pwd.getgrnam(value)`` or ``None`` to not
change the worker processes group. change the worker processes group.
.. _umask:
umask umask
~~~~~ ~~~~~
@ -439,6 +495,8 @@ with ``int(value, 0)`` (``0`` means Python guesses the base, so values
like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal
representations) representations)
.. _initgroups:
initgroups initgroups
~~~~~~~~~~ ~~~~~~~~~~
@ -451,6 +509,8 @@ group id.
.. versionadded:: 19.7 .. versionadded:: 19.7
.. _tmp-upload-dir:
tmp_upload_dir tmp_upload_dir
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -464,6 +524,8 @@ This path should be writable by the process permissions set for Gunicorn
workers. If not specified, Gunicorn will choose a system generated workers. If not specified, Gunicorn will choose a system generated
temporary directory. temporary directory.
.. _secure-scheme-headers:
secure_scheme_headers secure_scheme_headers
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
@ -482,6 +544,8 @@ when handling HTTPS requests.
It is important that your front-end proxy configuration ensures that It is important that your front-end proxy configuration ensures that
the headers defined here can not be passed directly from the client. the headers defined here can not be passed directly from the client.
.. _forwarded-allow-ips:
forwarded_allow_ips forwarded_allow_ips
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
@ -501,6 +565,8 @@ variable. If it is not defined, the default is ``"127.0.0.1"``.
Logging Logging
------- -------
.. _accesslog:
accesslog accesslog
~~~~~~~~~ ~~~~~~~~~
@ -511,6 +577,8 @@ The Access log file to write to.
``'-'`` means log to stdout. ``'-'`` means log to stdout.
.. _access-log-format:
access_log_format access_log_format
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
@ -545,6 +613,8 @@ p process ID
{Variable}e environment variable {Variable}e environment variable
=========== =========== =========== ===========
.. _errorlog:
errorlog errorlog
~~~~~~~~ ~~~~~~~~
@ -558,6 +628,8 @@ Using ``'-'`` for FILE makes gunicorn log to stderr.
.. versionchanged:: 19.2 .. versionchanged:: 19.2
Log to stderr by default. Log to stderr by default.
.. _loglevel:
loglevel loglevel
~~~~~~~~ ~~~~~~~~
@ -574,6 +646,8 @@ Valid level names are:
* error * error
* critical * critical
.. _capture-output:
capture_output capture_output
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -584,6 +658,8 @@ Redirect stdout/stderr to Error log.
.. versionadded:: 19.6 .. versionadded:: 19.6
.. _logger-class:
logger_class logger_class
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -600,6 +676,8 @@ Python path to a subclass like ``gunicorn.glogging.Logger``.
Alternatively the syntax can also load the Logger class Alternatively the syntax can also load the Logger class
with ``egg:gunicorn#simple``. with ``egg:gunicorn#simple``.
.. _logconfig:
logconfig logconfig
~~~~~~~~~ ~~~~~~~~~
@ -610,6 +688,8 @@ The log config file to use.
Gunicorn uses the standard Python logging module's Configuration Gunicorn uses the standard Python logging module's Configuration
file format. file format.
.. _syslog-addr:
syslog_addr syslog_addr
~~~~~~~~~~~ ~~~~~~~~~~~
@ -626,6 +706,8 @@ Address is a string of the form:
* ``udp://HOST:PORT`` : for UDP sockets * ``udp://HOST:PORT`` : for UDP sockets
* ``tcp://HOST:PORT`` : for TCP sockets * ``tcp://HOST:PORT`` : for TCP sockets
.. _syslog:
syslog syslog
~~~~~~ ~~~~~~
@ -634,6 +716,8 @@ syslog
Send *Gunicorn* logs to syslog. Send *Gunicorn* logs to syslog.
.. _syslog-prefix:
syslog_prefix syslog_prefix
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -645,6 +729,8 @@ Makes Gunicorn use the parameter as program-name in the syslog entries.
All entries will be prefixed by ``gunicorn.<prefix>``. By default the All entries will be prefixed by ``gunicorn.<prefix>``. By default the
program name is the name of the process. program name is the name of the process.
.. _syslog-facility:
syslog_facility syslog_facility
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
@ -653,6 +739,8 @@ syslog_facility
Syslog facility name Syslog facility name
.. _enable-stdio-inheritance:
enable_stdio_inheritance enable_stdio_inheritance
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
@ -666,6 +754,8 @@ Enable inheritance for stdio file descriptors in daemon mode.
Note: To disable the Python stdout buffering, you can to set the user Note: To disable the Python stdout buffering, you can to set the user
environment variable ``PYTHONUNBUFFERED`` . environment variable ``PYTHONUNBUFFERED`` .
.. _statsd-host:
statsd_host statsd_host
~~~~~~~~~~~ ~~~~~~~~~~~
@ -676,6 +766,8 @@ statsd_host
.. versionadded:: 19.1 .. versionadded:: 19.1
.. _statsd-prefix:
statsd_prefix statsd_prefix
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -690,6 +782,8 @@ if not provided).
Process Naming Process Naming
-------------- --------------
.. _proc-name:
proc_name proc_name
~~~~~~~~~ ~~~~~~~~~
@ -705,6 +799,8 @@ module.
If not set, the *default_proc_name* setting will be used. If not set, the *default_proc_name* setting will be used.
.. _default-proc-name:
default_proc_name default_proc_name
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
@ -715,6 +811,8 @@ Internal setting that is adjusted for each type of application.
Django Django
------ ------
.. _django-settings:
django_settings django_settings
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
@ -731,6 +829,8 @@ e.g. ``myproject.settings.main``. If this isn't provided, the
Server Mechanics Server Mechanics
---------------- ----------------
.. _pythonpath:
pythonpath pythonpath
~~~~~~~~~~ ~~~~~~~~~~
@ -742,6 +842,8 @@ A comma-separated list of directories to add to the Python path.
e.g. e.g.
``'/home/djangoprojects/myproject,/home/python/mylibrary'``. ``'/home/djangoprojects/myproject,/home/python/mylibrary'``.
.. _paste:
paste paste
~~~~~ ~~~~~
@ -758,6 +860,8 @@ command line arguments to control server configuration instead.
Server Hooks Server Hooks
------------ ------------
.. _on-starting:
on_starting on_starting
~~~~~~~~~~~ ~~~~~~~~~~~
@ -770,6 +874,8 @@ Called just before the master process is initialized.
The callable needs to accept a single instance variable for the Arbiter. The callable needs to accept a single instance variable for the Arbiter.
.. _on-reload:
on_reload on_reload
~~~~~~~~~ ~~~~~~~~~
@ -782,6 +888,8 @@ Called to recycle workers during a reload via SIGHUP.
The callable needs to accept a single instance variable for the Arbiter. The callable needs to accept a single instance variable for the Arbiter.
.. _when-ready:
when_ready when_ready
~~~~~~~~~~ ~~~~~~~~~~
@ -794,6 +902,8 @@ Called just after the server is started.
The callable needs to accept a single instance variable for the Arbiter. The callable needs to accept a single instance variable for the Arbiter.
.. _pre-fork:
pre_fork pre_fork
~~~~~~~~ ~~~~~~~~
@ -807,6 +917,8 @@ Called just before a worker is forked.
The callable needs to accept two instance variables for the Arbiter and The callable needs to accept two instance variables for the Arbiter and
new Worker. new Worker.
.. _post-fork:
post_fork post_fork
~~~~~~~~~ ~~~~~~~~~
@ -820,6 +932,8 @@ Called just after a worker has been forked.
The callable needs to accept two instance variables for the Arbiter and The callable needs to accept two instance variables for the Arbiter and
new Worker. new Worker.
.. _post-worker-init:
post_worker_init post_worker_init
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
@ -833,6 +947,8 @@ Called just after a worker has initialized the application.
The callable needs to accept one instance variable for the initialized The callable needs to accept one instance variable for the initialized
Worker. Worker.
.. _worker-int:
worker_int worker_int
~~~~~~~~~~ ~~~~~~~~~~
@ -846,6 +962,8 @@ Called just after a worker exited on SIGINT or SIGQUIT.
The callable needs to accept one instance variable for the initialized The callable needs to accept one instance variable for the initialized
Worker. Worker.
.. _worker-abort:
worker_abort worker_abort
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -861,6 +979,8 @@ This call generally happens on timeout.
The callable needs to accept one instance variable for the initialized The callable needs to accept one instance variable for the initialized
Worker. Worker.
.. _pre-exec:
pre_exec pre_exec
~~~~~~~~ ~~~~~~~~
@ -873,6 +993,8 @@ Called just before a new master process is forked.
The callable needs to accept a single instance variable for the Arbiter. The callable needs to accept a single instance variable for the Arbiter.
.. _pre-request:
pre_request pre_request
~~~~~~~~~~~ ~~~~~~~~~~~
@ -886,6 +1008,8 @@ Called just before a worker processes the request.
The callable needs to accept two instance variables for the Worker and The callable needs to accept two instance variables for the Worker and
the Request. the Request.
.. _post-request:
post_request post_request
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -899,6 +1023,8 @@ Called after a worker processes the request.
The callable needs to accept two instance variables for the Worker and The callable needs to accept two instance variables for the Worker and
the Request. the Request.
.. _worker-exit:
worker_exit worker_exit
~~~~~~~~~~~ ~~~~~~~~~~~
@ -912,6 +1038,8 @@ Called just after a worker has been exited.
The callable needs to accept two instance variables for the Arbiter and The callable needs to accept two instance variables for the Arbiter and
the just-exited Worker. the just-exited Worker.
.. _nworkers-changed:
nworkers_changed nworkers_changed
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
@ -928,6 +1056,8 @@ two integers of number of workers after and before change.
If the number of workers is set for the first time, *old_value* would If the number of workers is set for the first time, *old_value* would
be ``None``. be ``None``.
.. _on-exit:
on_exit on_exit
~~~~~~~ ~~~~~~~
@ -943,6 +1073,8 @@ The callable needs to accept a single instance variable for the Arbiter.
Server Mechanics Server Mechanics
---------------- ----------------
.. _proxy-protocol:
proxy_protocol proxy_protocol
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -965,6 +1097,8 @@ Example for stunnel config::
cert = /etc/ssl/certs/stunnel.pem cert = /etc/ssl/certs/stunnel.pem
key = /etc/ssl/certs/stunnel.key key = /etc/ssl/certs/stunnel.key
.. _proxy-allow-ips:
proxy_allow_ips proxy_allow_ips
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
@ -980,6 +1114,8 @@ you still trust the environment)
SSL SSL
--- ---
.. _keyfile:
keyfile keyfile
~~~~~~~ ~~~~~~~
@ -988,6 +1124,8 @@ keyfile
SSL key file SSL key file
.. _certfile:
certfile certfile
~~~~~~~~ ~~~~~~~~
@ -996,6 +1134,8 @@ certfile
SSL certificate file SSL certificate file
.. _ssl-version:
ssl_version ssl_version
~~~~~~~~~~~ ~~~~~~~~~~~
@ -1004,6 +1144,8 @@ ssl_version
SSL version to use (see stdlib ssl module's) SSL version to use (see stdlib ssl module's)
.. _cert-reqs:
cert_reqs cert_reqs
~~~~~~~~~ ~~~~~~~~~
@ -1012,6 +1154,8 @@ cert_reqs
Whether client certificate is required (see stdlib ssl module's) Whether client certificate is required (see stdlib ssl module's)
.. _ca-certs:
ca_certs ca_certs
~~~~~~~~ ~~~~~~~~
@ -1020,6 +1164,8 @@ ca_certs
CA certificates file CA certificates file
.. _suppress-ragged-eofs:
suppress_ragged_eofs suppress_ragged_eofs
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -1028,6 +1174,8 @@ suppress_ragged_eofs
Suppress ragged EOFs (see stdlib ssl module's) Suppress ragged EOFs (see stdlib ssl module's)
.. _do-handshake-on-connect:
do_handshake_on_connect do_handshake_on_connect
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@ -1036,6 +1184,8 @@ do_handshake_on_connect
Whether to perform SSL handshake on socket connect (see stdlib ssl module's) Whether to perform SSL handshake on socket connect (see stdlib ssl module's)
.. _ciphers:
ciphers ciphers
~~~~~~~ ~~~~~~~
@ -1047,6 +1197,8 @@ Ciphers to use (see stdlib ssl module's)
Server Mechanics Server Mechanics
---------------- ----------------
.. _raw-paste-global-conf:
raw_paste_global_conf raw_paste_global_conf
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~