uWSGI and the various plugins it consists of is almost infinitely configurable.
There's an exhaustive and exhausting list of all options below. Take a deep breath and don't panic -- the list below is long, but you don't need to know everything to start using uWSGI.
Argument: string
Bind to the specified socket using default protocol (see protocol).
This option may be set with -s
from the command line.
Argument: string
Bind to the specified socket using HTTP.
Argument: string
Bind to the specified socket using FastCGI.
Argument: string
Force the specified protocol (uwsgi, http, fastcgi) for default sockets.
Argument: string
Create a shared socket for advanced jailing or IPC purposes.
Advanced option for plugin writers or special needs. Allows you to create a socket early in the server's startup and use it after privileges drop or jailing. This can be used to bind to privileged (<1024) ports.
Argument: number Default: 100
Set the socket listen queue size.
This option may be set with -l
from the command line.
Every socket has an associated queue where request will be put waiting for a process to became ready to accept them. When this queue is full, requests will be rejected.
The maximum value is system/kernel dependent.
Argument: no argument
Force UNIX socket into abstract mode (Linux only).
Argument: optional string
Chmod socket.
This option may be set with -C
from the command line.
UNIX sockets are filesystem objects that obey UNIX permissions like any other filesystem object. You can set the UNIX sockets' permissions with this option if your webserver would otherwise have no access to the uWSGI socket. When used without a parameter, the permissions will be set to 666. Otherwise the specified chmod value will be used.
Argument: string
Chown UNIX sockets.
Argument: string
Set UNIX socket umask.
Argument: no argument
Put socket in freebind mode (Linux only).
Allows binding to non-existent network addresses.
Argument: string
Map sockets to specific workers.
This option may be declared multiple times.
As you can bind a uWSGI instance to multiple sockets, you can use this option to map specific workers to specific sockets to implement a sort of in-process Quality of Service scheme.
This will map workers 1, 2 and 3 to the first socket and 4 and 5 to the second one.
If you host multiple apps in the same uWSGI instance, you can easily dedicate resources to each of them.
Argument: string
Create a zeromq pub/sub pair.
Argument: string
Run the udp server on the specified address.
Mainly useful for SNMP or shared UDP logging. .. :seealso:: :doc:`Logging`, :doc:`SNMP`
Argument: no argument
Enable REUSE_PORT flag on socket to allow multiple instances binding on the same address (BSD only).
Argument: number
Spawn the specified number of workers/processes.
This option may be set with -p
from the command line.
Set the number of workers for preforking mode.
This is the base for easy and safe concurrency in your app. More workers you add, more concurrent requests you can manage.
Each worker corresponds to a system process, so it consumes memory, choose carefully the right number. You can easily drop your system to its knees by setting a too high value.
Setting workers
to a ridiculously high number will not magically make your application web scale -- quite the contrary.
Argument: number
Harakiri timeout in seconds.
Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the corresponding worker is thereafter recycled.
Argument: no argument
Enable verbose Harakiri mode.
When a request is killed by Harakiri you will get a message in the uWSGI log. Enabling this option will print additional info (for example, the current syscall will be reported on Linux platforms).
Argument: no argument
Disallow Harakiri killings during after-request hook methods.
Argument: number
Set harakiri timeout for mule tasks.
Argument: no argument
Enable uWSGI master process.
This option may be set with -M
from the command line.
Argument: no argument
Call waitpid(-1,...) after each request to get rid of zombies.
This option may be set with -r
from the command line.
Enables reaper mode. After each request the server will call waitpid(-1)
to get rid of zombie processes.
If you spawn subprocesses in your app and you happen to end up with zombie processes all over the place you can enable this option. (It really would be better if you could fix your application's process spawning usage though.)
Argument: number
Reload workers after the specified amount of managed requests (avoid memory leaks).
This option may be set with -R
from the command line.
When a worker reaches this number of requests it will get recycled (killed and restarted). You can use this option to "dumb fight" memory leaks.
Also take a look at the reload-on-as
and reload-on-rss
options as they are more useful for memory leaks.
Argument: number
Limit process address space (vsz) (in megabytes).
Limits the address space usage of each uWSGI (worker) process using POSIX/UNIX setrlimit()
.
For example, limit-as 256
will disallow uWSGI processes to grow over 256MB of address space.
Address space is the virtual memory a process has access to. It does not correspond to physical memory.
Read and understand this page before enabling this option: http://en.wikipedia.org/wiki/Virtual_memory
Argument: number
Limit the number of spawnable processes.
Argument: number
Reload a worker if its address space usage is higher than the specified value (in megabytes).
Argument: number
Reload a worker if its physical unshared memory is higher than the specified value (in megabytes).
Argument: number
Force the master to reload a worker if its address space is higher than specified megabytes (in megabytes).
Argument: number
Force the master to reload a worker if its rss memory is higher than specified megabytes (in megabytes).
Argument: number
Run each worker in prethreaded mode with the specified number of threads per worker.
Argument: number
Set threads stacksize.
Argument: number Default: 1
Set the interval (in seconds) of master checks.
The master process makes a scan of subprocesses, etc. every N seconds. You can increase this time if you need to, but it's DISCOURAGED.
.. seealso:: :doc:`Emperor`
Argument: string
Run as the Emperor, using the given configuration method.
This option may be declared multiple times.
Argument: number Default: 3
Set the Emperor scanning frequency in seconds.
Argument: string
Write the Emperor pid in the specified file.
Argument: no argument
Put the Emperor in Tyrant (multi-user hosting) mode.
Argument: string
Run the imperial bureau of statistics on the given address:port.
Argument: no argument
Spawn the emperor before jailing and privilege dropping.
Argument: number
Run the emperor in Broodlord mode. .. :seealso:: :doc:`Broodlord`
Argument: number Default: 1000
Set throttling level (in milliseconds) for bad behaving vassals.
Argument: number Default: 180000
Set max throttling level (in milliseconds) for badly behaving vassals (default 3 minutes).
Argument: no argument
Prefix vassals config files with exec as s:// if they have the executable bit.
Argument: no argument
List enabled imperial monitors.
Argument: string
Add given config templates to vassals' config.
This option may be declared multiple times.
Argument: string
Run the specified command before each vassal starts.
Argument: string
Run the specified command after vassal's death.
Argument: number
Ask emperor for sos if backlog queue has more items than the value specified.
Argument: number
(Vassal option) Announce vassal health to the emperor every N seconds.
Argument: number Default: 30
Set the Emperor tolerance about heartbeats.
When a vassal asks for 'heartbeat mode' the emperor will also expect a 'heartbeat' at least every <secs> seconds.
Argument: optional number
Automatically make workers snapshot after reload. .. :seealso:: :doc:`Snapshot`
Argument: number
Set the maximum time (in seconds) a worker can take to reload/shutdown.
For example reload-mercy 8
would brutally kill every worker that will not terminate itself within 8 seconds during graceful reload
.. seealso:: :doc:`Zerg`
Argument: string
Attach to a zerg server.
This option may be declared multiple times.
Argument: no argument
Fallback to normal sockets if the zerg server is not available.
Argument: string
Enable the zerg server on the specified UNIX socket.
Argument: string
Start a zergpool on specified address for specified address (zergpool plugin).
This option may be declared multiple times.
Argument: number
Set backtrace depth.
Argument: no argument
Enable memory usage report.
This option may be set with -m
from the command line.
When enabled, diagnostic information about RSS and address space usage will be printed in the request log.
Argument: string
Enable the specified profiler.
Argument: no argument
Dump the full list of available options.
Argument: no argument
Show the current config reformatted as ini.
Argument: string
Simple print (for your convenience).
Argument: no argument
Report uWSGI CFLAGS (useful for building external plugins).
Argument: no argument
Print uWSGI version.
Argument: string
Comma separated list of allowed modifiers for clients.
allowed-modifiers 0,111
would allow access to only the WSGI handler and the cache handler.
Argument: str
Connect to a socket and wait for data from it.
.. seealso:: :doc:`Configuration`
Argument: string
Set a custom placeholder for configuration.
Argument: string
Declare a new custom uWSGI option.
Argument: string
Use the specified file as configuration template.
Argument: string
Include the specified file as if its configuration entries had been declared here (available post 1.3).
Argument: string
Load uWSGI plugins (comma-separated).
This option may be declared multiple times.
Argument: string
Add a directory to uWSGI plugin search path.
This option may be declared multiple times.
Argument: no argument
List enabled plugins.
Argument: no argument
Try to automatically load plugins when unknown options are found.
Argument: string
Blindly load a shared library.
Argument: number
Load config from ini file.
Argument: string
Load XML file as configuration.
This option may be set with -x
from the command line.
Argument: string
Load config from yaml file.
This option may be set with -y
from the command line.
Argument: string
Load config from json file.
This option may be set with -j
from the command line.
Argument: number
Load config from sqlite3 db.
Argument: number
Load configuration from ldap server. .. :seealso:: :doc:`LDAP`
Argument: no argument
Dump uWSGI ldap schema. .. :seealso:: :doc:`LDAP`
Argument: no argument
Dump uWSGI ldap schema in ldif format. .. :seealso:: :doc:`LDAP`
.. seealso:: :doc:`ConfigLogic`
Argument: string
For cycle.
Argument: optional string
End for cycle.
Argument: string
Check for option.
Argument: string
Check for lack of option.
Argument: string
Check for environment variable.
Argument: string
Check for lack of environment variable.
Argument: string
Check for reload.
Argument: string
Check for lack of reload.
Argument: string
Check for file/directory existence.
Argument: string
Check for file/directory inexistence.
Argument: string
Check for file existence.
Argument: string
Check for file inexistence.
Argument: string
Check for directory existence.
Argument: string
Check for directory inexistence.
Argument: optional string
End if block.
.. seealso:: :doc:`Logging`
Argument: no argument
Disable request logging.
This option may be set with -L
from the command line.
When enabled, only uWSGI internal messages and errors are logged.
Argument: no argument
Do not report (annoying) SIGPIPE.
Argument: no argument
Do not report (annoying) write()/writev() errors.
Argument: number
Set the maximum number of allowed write errors (default: no tolerance).
Argument: no argument
Only raise an exception on write errors giving control to the app itself.
Argument: no argument
Disable exception generation on write()/writev().
Argument: string
Set logfile/udp address.
Argument: string
Log to specified file or udp address after privileges drop.
Argument: string
Set advanced format for request logging.
Argument: no argument
Apply strftime to logformat output.
Argument: no argument
Chown logfiles.
Argument: string
Chmod logfiles.
Argument: optional string
Log to syslog.
Passing a parameter makes uwsgi use the parameter as program-name in the syslog entry header.
Argument: string
Send logs to the specified socket.
Argument: string
Set/append a logger.
This option may be declared multiple times.
Argument: no argument
List enabled loggers.
Argument: no argument
Offload log writing to a thread.
Argument: regexp
Drain (do not show) log lines matching the specified regexp.
This option may be declared multiple times.
Argument: string
Send logs to a ZeroMQ server.
Argument: no argument
Delegate logging to master process.
Delegate the write of the logs to the master process (this will put all of the logging I/O to a single process). Useful for system with advanced I/O schedulers/elevators.
Argument: number
Set the buffer size for the master logger. Log messages larger than this will be truncated.
Argument: no argument
Reopen log after reload.
Argument: no argument
Truncate log on startup.
Argument: number
Set maximum logfile size.
Argument: string
Set logfile name after rotation.
Argument: optional string
Prefix log lines with date (without argument) or a strftime string.
Argument: no argument
Log responses without body (zero response size).
Argument: number
Log requests slower than the specified number of milliseconds.
Argument: no argument
Log requests with a 4xx response.
Argument: no argument
Log requests with a 5xx response.
Argument: number
Log requestes bigger than the specified size in bytes.
Argument: no argument
Log sendfile requests.
Argument: no argument
Report response time in microseconds instead of milliseconds.
Argument: no argument
Use the ip from X-Forwarded-For header instead of REMOTE_ADDR. Used when uWSGI is run behind multiple proxies.
Argument: string
Enable the stats server on the specified address.
Argument: no argument
Be verbose about SSL errors.
Argument: string
Enable the embedded SNMP server.
This option may be declared multiple times. .. :seealso:: :doc:`SNMP`
Argument: string
Set the SNMP community string.
.. seealso:: :doc:`Alarms`
Argument: string
Create a new alarm. Syntax: <alarm> <plugin:args>.
This option may be declared multiple times.
Argument: number
Tune the alarm anti-loop system (default 3 seconds).
Argument: string
Raise the specified alarm when a log line matches the specified regexp, syntax: <alarm>[,alarm...] <regexp>.
This option may be declared multiple times.
Argument: no argument
List enabled alarms.
Argument: logfile
Daemonize uWSGI and write messages into given log file or UDP socket address. .. :seealso:: :doc:`Logging`
Argument: logfile
Daemonize uWSGI after loading application, write messages into given log file or UDP socket address. .. :seealso:: :doc:`Logging`
Argument: pidfile
Send the stop (SIGINT) signal to the instance described by the pidfile. .. :seealso:: :doc:`Management`
Argument: pidfile
Send the reload (SIGHUP) signal to the instance described by the pidfile. .. :seealso:: :doc:`Management`
Argument: pidfile
Send the pause (SIGTSTP) signal to the instance described by the pidfile. .. :seealso:: :doc:`Management`
Argument: pidfile
Send the suspend (SIGTSTP) signal to the instance described by the pidfile. .. :seealso:: :doc:`Management`
Argument: pidfile
Send the resume (SIGTSTP) signal to the instance described by the pidfile. .. :seealso:: :doc:`Management`
Argument: no argument
Automatically set process name to something meaningful.
Generated process names may be 'uWSGI Master', 'uWSGI Worker #', etc.
Argument: string
Add prefix to process names.
Argument: string
Add spaced prefix to process names.
Argument: string
Append string to process names.
Argument: string
Set process name to given value.
Argument: string
Set master process name to given value.
Argument: string
Create pidfile (before privileges drop).
Argument: string
Create pidfile (after privileges drop).
Argument: string
Chroot() to the specified directory.
Argument: username|uid
Setuid to the specified user/uid.
Argument: groupname|gid
Setgid to the specified grooup/gid.
Argument: no argument
Disable additional groups set via initgroups().
Argument: string
Set process capability.
Argument: string
Unshare() part of the processes and put it in a new namespace.
Argument: string
Run the specified command before jailing.
This option may be declared multiple times.
Argument: string
Run the specified command after jailing.
This option may be declared multiple times.
Argument: string
Run the specified command in jail after initialization.
This option may be declared multiple times.
Argument: string
Run the specified command before privileges drop.
This option may be declared multiple times.
Argument: string
Run the specified command after privileges drop.
This option may be declared multiple times.
Argument: string
Run the specified command before app exit and reload.
This option may be declared multiple times.
Argument: string
Run the specified command before app loading.
This option may be declared multiple times.
Argument: string
Put the processes in the specified cgroup (Linux only).
This option may be declared multiple times. .. :seealso:: :doc:`Cgroups`
Argument: string
Set value in specified cgroup option.
This option may be declared multiple times. .. :seealso:: :doc:`Cgroups`
Argument: string
Run in a new namespace under the specified rootfs. .. :seealso:: :doc:`Namespaces`
Argument: <mount>[:<jailed-mountpoint>]
Keep the specified mountpoint in your namespace, optionally renaming it. .. :seealso:: :doc:`Namespaces`
Argument: string
Add network namespace.
Argument: number
Sleep for the specified number of seconds when a forkbomb is detected.
Argument: string
Force binary path.
If you do not have uWSGI in the system path you can force its path with this option to permit the reloading system and the Emperor to easily find the binary to execute.
Argument: string
Patch the uwsgi binary with a new command (before privileges drop).
Argument: string
Patch the uwsgi binary with a new command (after privileges drop).
Argument: string
Patch the uwsgi binary with a new command and arguments (before privileges drop).
Argument: string
Patch the uwsgi binary with a new command and arguments (after privileges drop).
Argument: number
Enable async mode with specified cores. .. :seealso:: :doc:`Async`
Argument: number
Set maximum number of file descriptors (requires root privileges).
Argument: no argument
Leave master process running as root.
Argument: no argument
Skip check of file descriptor 0.
Argument: no argument
Exit if no app can be loaded.
Argument: no argument
Force exit even if a reload is requested.
Argument: no argument
Exit instead of brutal reload on SIGTERM.
Argument: no argument
Disable file descriptor passing.
Argument: no argument
Do not use multiple interpreters (where available).
This option may be set with -i
from the command line.
Some of the supported languages (such as Python) have the concept of "multiple interpreters". This feature allows you to isolate apps living in the same process. If you do not want this kind of feature use this option.
Argument: number
Set the maximum number of per-worker applications.
Argument: number
Create a raw shared memory area of specified number of pages.
This option may be set with -A
from the command line.
This enables the SharedArea. This is a low level shared memory. If you want a more usable/user-friendly system look at the caching framework. .. :seealso:: :doc:`SharedArea`
Argument: no argument
Force CGI-mode for plugins supporting it.
This option may be set with -c
from the command line.
When enabled, responses generated by uWSGI will not be HTTP responses, but CGI ones; namely, the Status:
header will be added.
Argument: number Default: 4096
Set the internal buffer size for uwsgi packet parsing.
This option may be set with -b
from the command line.
If you plan to receive big requests with lots of headers you can increase this value up to 64k (65535).
Argument: no argument
Enable threads.
This option may be set with -T
from the command line.
Enable threads in the embedded languages. This will allow to spawn threads in your app.
Warning
Threads will simply not work if this option is not enabled. There will likely be no error, just no execution of your thread code.
Argument: number
Set buffer size for signal queue.
Argument: number Default: 4
Set internal sockets timeout in seconds.
This option may be set with -z
from the command line.
Argument: number
Set the amount of internal iovec/vars structures for uwsgi clients (web servers, etc.).
This option may be set with -v
from the command line.
This is only a security measure you will probably never need to touch.
Argument: number
Weight of the instance (used by clustering/lb/subscriptions).
Argument: number
Set weight of the instance (used by clustering/lb/subscriptions) automatically.
Argument: no argument
Initialize the uWSGI server but exit as soon as the initialization is complete (useful for testing).
Argument: no argument
Force command mode.
Argument: no argument
Disable deferred accept()
on sockets.
by default (where available) uWSGI will defer the accept() of requests until some data is sent by the client (this is a security/performance measure). If you want to disable this feature for some reason, specify this option.
Argument: no argument
Enable TCP KEEPALIVEs.
Argument: no argument
Lock all memory pages avoiding swapping.
Argument: number
Enable Linux KSM.
This option may be declared multiple times.
Argument: string
Reload uWSGI if the specified file or directory is modified/touched.
This option may be declared multiple times.
Argument: string
Trigger logrotation if the specified file is modified/touched.
This option may be declared multiple times.
Argument: string
Trigger log reopen if the specified file is modified/touched.
This option may be declared multiple times.
Argument: no argument
Over-engineering option for system with flaky signal mamagement.
Argument: no argument
Automatically kill workers if master dies (can be dangerous for availability).
Argument: number
Set processes/threads priority (nice
) value.
Argument: number of cores for each worker (Linux only)
Set CPU affinity.
Set the number of cores (CPUs) to allocate to each worker process.
For example
- With 4 workers, 4 CPUs and
cpu-affinity
is 1, each worker is allocated one CPU. - With 4 workers, 2 CPUs and
cpu-affinity
is 1, workers get one CPU each (0; 1; 0; 1). - With 4 workers, 4 CPUs and
cpu-affinity
is 2, workers get two CPUs each in a round-robin fashion (0, 1; 2, 3; 0, 1; 2; 3). - With 8 workers, 4 CPUs and
cpu-affinity
is 3, workers get three CPUs each in a round-robin fashion (0, 1, 2; 3, 0, 1; 2, 3, 0; 1, 2, 3; 0, 1, 2; 3, 0, 1; 2, 3, 0; 1, 2, 3).
Argument: string
Remap request modifier from one id to another (old-id:new-id).
Argument: string
Set environment variable (key=value).
Argument: string
Set environment variable (key).
Argument: no argument
Set close-on-exec on sockets (could be required for spawning processes in requests).
Argument: string
Set uWSGI custom mode.
Generic mode option that is passed down to applications as uwsgi.mode
(or similar for other languages)
Argument: no argument
Try to remove all of the generated files/sockets (UNIX sockets and pidfiles) upon exit.
Argument: string
Add a cron task.
Argument: string
Run the specified command as worker instead of uWSGI itself.
This could be used to run a PHP FastCGI server pool:
/usr/bin/uwsgi --workers 4 --worker-exec /usr/bin/php53-cgi
Argument: string
Attach a command/daemon to the master process (the command has to remain in foreground).
This will allow the uWSGI master to control/monitor/respawn this process.
A typical usage is attaching a memcached
instance:
[uwsgi] master = true attach-daemon = memcached
Argument: pidfile
Attach a command/daemon to the master process managed by a pidfile (the command must daemonize).
Argument: pidfile
Attach a command/daemon to the master process managed by a pidfile (the command must NOT daemonize).
.. seealso:: :doc:`Locks`
Argument: number
Create the specified number of shared locks.
Argument: string
Set the lock engine.
Argument: string
Set the ipcsem key via ftok() for avoiding duplicates.
Argument: string
Lock the specified file before starting, exit if locked.
Argument: string
Lock the specified file before starting, wait if locked.
Argument: string
Lock the specified file after logging/daemon setup, exit if locked.
Argument: string
Lock the specified file after logging/daemon setup, wait if locked.
.. seealso:: :doc:`Caching`
Argument: number
Create a shared cache containing given elements.
Argument: number Default: 65536
Set the cache block size in bytes. It's a good idea to use a multiple of 4096 (common memory page size).
Argument: string
Enable persistent cache to disk.
Argument: number
Set frequency of sync for persistent cache.
Argument: string
Enable the threaded cache server.
Argument: number
Set the number of threads for the cache server.
Argument: no argument
Disable auto sweep of expired items.
Argument: number
Set the frequency of cache sweeper scans (default 3 seconds).
Argument: no argument
Constantly report the cache item freed by the sweeper (use only for debug).
.. seealso:: :doc:`Queue`
Argument: number
Enable the shared queue with the given size.
Argument: number
Set the block size for the queue.
Argument: filename
Enable periodical persisting of the queue to disk.
Argument: number
Set periodical persisting frequency in seconds.
.. seealso:: :doc:`Spooler`
Argument: string
Run a spooler on the specified directory.
This option may be set with -Q
from the command line.
Argument: string
Map spooler requests to a spooler directory, but do not start a spooler (spooling managed by external instance).
Argument: no argument
Try to order the execution of spooler tasks.
Argument: string
Chdir() to specified directory before each spooler task.
Argument: number
Set the number of processes for spoolers.
Argument: no argument
Do not be verbose with spooler tasks.
Argument: number
Set the maximum number of tasks to run before recycling a spooler.
Argument: number
Set harakiri timeout for spooler tasks.
.. seealso:: :doc:`Mules`
Argument: string
Add a mule (signal-only mode without argument).
This option may be declared multiple times.
Argument: number
Add the specified number of mules.
Argument: string
Add a mule farm.
Argument: string
Send a uwsgi signal to a server.
Argument: string
Chdir to specified directory before apps loading.
Argument: string
Chdir to specified directory after apps loading.
Argument: no argument
Set lazy mode (load apps in workers instead of master).
This option may have memory usage implications as Copy-on-Write semantics can not be used.
Argument: no argument
Load apps in each worker instead of the master.
Argument: no argument
Set cheap mode (spawn workers only after the first request).
Argument: number
Set cheaper mode (adaptive process spawning).
This an advanced cheap mode. This will only spawn <n> workers on startup and will use various (pluggable) algorithms to implement adaptive process spawning.
Argument: number
Set the initial number of processes to spawn in cheaper mode.
Argument: string
Choose to algorithm used for adaptive process spawning).
Argument: number
Number of additional processes to spawn at each overload.
Argument: number
Increase workers after specified overload.
Argument: no argument
List enabled 'cheaper' algorithms.
Argument: number
Set idle mode (put uWSGI in cheap mode after inactivity).
Argument: no argument
Shutdown uWSGI when idle.
Argument: /mountpoint=/app/path
Load application under mountpoint.
Example: mount /pinax=/var/www/pinax/deploy/pinax.wsgi
Argument: string
Load application under mountpoint in the specified worker or after workers spawn.
This option may be declared multiple times.
Argument: no argument
Enable grunt mode (in-request fork).
Argument: number
Limit request body (bytes) based on the CONTENT_LENGTH
uwsgi var.
Argument: number
Enable post buffering past N bytes.
Enables HTTP body buffering. uWSGI will save to disk all HTTP bodies larger than the limit specified. This option is required and auto-enabled for Ruby Rack applications as they require a rewindable input stream.
Argument: number
Set buffer size for read() in post buffering mode.
This is an advanced option you probably won't need to touch.
Argument: string
Enable creation of .json files in the specified directory during a file upload.
Enable the embedded upload progress system.
Pass the name of a directory where uWSGI has write permissions into.
For every upload with a X-Progress-ID
query string ("GET") parameter, a JSON file will be written to this directory containing the status of the upload.
AJAX calls can then be used to read these files.
For instance, when upload-progress
is set to /var/www/progress
the user uploads a file to the URL:
/upload?X-Progress-ID=550e8400-e29b-41d4-a716-446655440000
uWSGI find X-Progress-ID
in the query string and create a file called :file:`/var/www/progress/550e8400-e29b-41d4-a716-446655440000.js` containing something like:
{"state": "uploading", "received": 170000, "size": 300000}
If :file:`/var/www/progress` has been mapped to the /progress
path in your web server, you can then request this file at /progress/550e8400-e29b-41d4-a716-446655440000.js
.
It's likely that your web server supports similar functionality (Nginx does, at least), but the uWSGI implementation is ostensibly more controllable and hackable.
Argument: no argument
Do not fallback to default app.
By default, when uWSGI does not find a corresponding app for the specified SCRIPT_NAME
variable, it will use the default app
(most of the time the app mounted under /). Enabling this option will return an error in case of unavailable app.
Argument: no argument
Automatically rewrite SCRIPT_NAME and PATH_INFO.
If for some reason your webserver cannot manage SCRIPT_NAME
on its own you can force uWSGI to rebuild the PATH_INFO
variable automatically from it.
Argument: no argument
Ignore SCRIPT_NAME.
Argument: no argument
Report exception as HTTP output.
Warning
This option is heavily discouraged as it is a definite security risk.
Argument: no argument
Reload a worker when an exception is raised.
Argument: string
Reload a worker when a specific exception type is raised.
This option may be declared multiple times.
Argument: string
Reload a worker when a specific exception value is raised.
This option may be declared multiple times.
Argument: string
Reload a worker when a specific exception type+value (language-specific) is raised.
This option may be declared multiple times.
Argument: string
Automatically add HTTP headers to response.
This option may be declared multiple times.
Argument: no argument
Enable virtualhosting mode (based on SERVER_NAME variable). .. :seealso:: :doc:`VirtualHosting`
Argument: no argument
Enable virtualhosting mode (based on HTTP_HOST variable).
By default the virtualhosting mode use the SERVER_NAME variable as the hostname key. If you want to use the HTTP_HOST one (corresponding to the Host: header) add this option .. :seealso:: :doc:`VirtualHosting`
Argument: string
Subscribe to specified multicast group. internal option, usable by third party plugins.
Argument: number
Set multicast ttl.
Argument: string
Join specified uWSGI cluster.
Argument: address:port
Get nodes list from the specified cluster without joining it.
This list is used internally by the uwsgi load balancing api.
Argument: address:port
Send a graceful reload message to the cluster.
Argument: address:port
Send a log line to the cluster.
For instance, --cluster-log "Hello, world!"
will print that to each cluster node's log file.
.. seealso:: :doc:`SubscriptionServer`
Argument: string
Set digest algorithm and certificate directory for secured subscription system.
Argument: number
Set the maximum tolerance (in seconds) of clock skew for secured subscription system.
Argument: string
Set load balancing algorithm for the subscription system.
Argument: no argument
Try to fallback to the next part (dot based) in subscription key.
Argument: string
Subscribe to the specified subscription server.
This option may be declared multiple times.
Argument: number
Send subscription announce at the specified interval.
Argument: number
Set tolerance for subscription servers.
Argument: no argument
Force unsubscribe request even during graceful reload.
.. seealso:: :doc:`InternalRouting`
Argument: string
Add a route.
This option may be declared multiple times.
Argument: string
Add a route based on Host header.
This option may be declared multiple times.
Argument: string
Add a route based on REQUEST_URI.
This option may be declared multiple times.
Argument: string
Add a route based on QUERY_STRING.
This option may be declared multiple times.
Argument: no argument
List enabled routers.
Argument: string
Check for static files in the specified directory.
This option may be declared multiple times.
Specify a directory that uWSGI will check before passing control to a specific handler.
uWSGI will check if the requested PATH_INFO
has a file correspondence in this directory and serve it.
For example, with check-static /var/www/example.com
, uWSGI will check if :file:`/var/www/example.com/foo.png` exists and directly serve it using sendfile() (or another configured method).
Argument: no argument
Check for static files in the requested DOCUMENT_ROOT.
Argument: string
Map mountpoint to static directory (or file).
This option may be declared multiple times.
Whenever a PATH_INFO starts with one of the configured resources, uWSGI will serve the file as a static file.
Argument: string
Map mountpoint to static directory (or file), completely appending the requested resource to the docroot.
This option may be declared multiple times.
Argument: string
Skip specified extension from staticfile checks.
This option may be declared multiple times.
Argument: string
Search for specified file if a directory is requested.
This option may be declared multiple times.
With static-index=index.html
, if the client asks for /doc/
then uWSGI will check for /doc/index.html
and if it exists it will be served to the client.
Argument: string
Set mime types file path (default /etc/mime.types).
This option may be declared multiple times.
Argument: string
Set the Expires header based on content type (syntax: Content-type=Expires).
This option may be declared multiple times.
Argument: string
Set the Expires header based on content type and file mtime (syntax: Content-type=Expires).
This option may be declared multiple times.
Argument: string
Set the Expires header based on filename regexp (syntax x=y).
This option may be declared multiple times.
Argument: string
Set the Expires header based on filename regexp and file mtime (syntax x=y).
This option may be declared multiple times.
Argument: string
Set the Expires header based on REQUEST_URI regexp (syntax x=y).
This option may be declared multiple times.
Argument: string
Set the Expires header based on REQUEST_URI regexp and file mtime (syntax x=y).
This option may be declared multiple times.
Argument: string
Set the Expires header based on PATH_INFO regexp (syntax x=y).
This option may be declared multiple times.
Argument: string
Set the Expires header based on PATH_INFO regexp and file mtime (syntax x=y).
This option may be declared multiple times.
Argument: number
Offload static file serving to a thread (upto the specified number of threads).
Argument: string
Set static file serving mode (x-sendfile, nginx, ...).
Set the static serving mode:
x-sendfile
will use the X-Sendfile header supported by Apache, Cherokee, lighttpdx-accel-redirect
will use the X-Accel-Redirect header supported by Nginx
By default the sendfile() syscall is used.
Argument: no argument
Check for response data in the cache based on PATH_INFO.
Argument: string
Set a clock source.
Argument: no argument
List enabled clocks.
Argument: string
Select the uWSGI loop engine (advanced). .. :seealso:: :doc:`LoopEngine`
Argument: no argument
List enabled loop engines.
.. seealso:: :doc:`Greenlet`
Argument: no argument
Enable greenlet as suspend engine.
.. seealso:: :doc:`Gevent`
Argument: number
A shortcut enabling gevent loop engine with the specified number of async cores and optimal parameters.
.. seealso:: :doc:`Stackless`
Argument: no argument
Use stackless as suspend engine.
.. seealso:: :doc:`uGreen`
Argument: no argument
Enable uGreen as suspend/resume engine.
Argument: number
Set ugreen stack size in pages.
.. seealso:: :doc:`Carbon`
Argument: host:port
Push statistics to the specified carbon server/port.
This option may be declared multiple times.
Argument: number Default: 3
Set Carbon connection timeout in seconds.
Argument: number Default: 60
Set Carbon push frequency in seconds.
Argument: string
Set the identifier for Carbon metrics (by default the first uWSGI socket name).
Argument: no argument
Disable generation of single worker metrics.
Argument: number
Set maximum number of retries in case of connection errors (default 1).
Argument: number
Set connection retry delay in seconds (default 7).
.. seealso:: :doc:`CGI`
Argument: [mountpoint=]script
Add a CGI directory/script with optional mountpoint (URI prefix).
Argument: extension=helper-executable
Add a cgi helper to map an extension into an executable.
Argument: no argument
Blindly enable cgi in DOCUMENT_ROOT.
Argument: number
Set the CGI buffer size.
Argument: number
Set CGI script timeout.
Argument: string
Add a CGI index file.
This option may be declared multiple times.
Argument: string
Allowed extensions for CGI.
This option may be declared multiple times.
Argument: string
Unset specified environment variables before running CGI executable.
This option may be declared multiple times.
Argument: string
Load a CGI shared library/optimizer.
This option may be declared multiple times.
Argument: no argument
Enable CGI realpath() optimizer.
Argument: no argument
Disable PATH_INFO management in CGI scripts.
.. seealso:: :doc:`Cheaper`
Argument: number
Set the cheaper busyness high percent limit, above that value worker is considered loaded (default 50).
Argument: number
Set the cheaper busyness low percent limit, belowe that value worker is considered idle (default 25).
Argument: number
Set initial cheaper multiplier, worker needs to be idle for cheaper-overload*multiplier seconds to be cheaped (default 10).
Argument: number
Penalty for respawning workers to fast, it will be added to the current multiplier value if worker is cheaped and than respawned back too fast (default 2).
Argument: no argument
Enable verbose log messages from busyness algorithm.
Argument: number
Spawn emergency worker if anytime listen queue is higher than this value (default 33) (Linux only).
Argument: number
Set cheaper multiplier used for emergency workers (default 3) (Linux only).
Argument: number
Number of emergency workers to spawn at a time (default 1) (Linux only).
.. seealso:: :doc:`Erlang`
Argument: string
Spawn an Erlang c-node.
Argument: string
Set Erlang cookie.
.. seealso:: :doc:`Fastrouter`
Argument: address:port
Run the fastrouter (uwsgi protocol proxy/load balancer) on the specified address:port.
Argument: number
Prefork the specified number of fastrouter processes.
Argument: corerouter zerg
Attach the fastrouter to a zerg server.
Argument: no argument
Use uWSGI cache as hostname->server mapper for the fastrouter.
Argument: corerouter use pattern
Use a pattern for fastrouter hostname->server mapping.
Argument: corerouter use base
Use a base dir for fastrouter hostname->server mapping.
Argument: string
Fallback to the specified node in case of error.
This option may be declared multiple times.
Argument: no argument
Load balance to nodes subscribed to the cluster.
Argument: corerouter cs
Use code string as hostname->server mapper for the fastrouter.
Argument: optional corerouter use socket
Forward request to the specified uwsgi socket.
Argument: string
Forward requests to the specified uwsgi server (you can specify it multiple times for load balancing).
This option may be declared multiple times.
Argument: number
Retry connections to dead static nodes after the specified amount of seconds.
Argument: number
Set the maximum number of concurrent events the fastrouter can return in one cycle.
Argument: no argument
Do not report failed connections to instances.
Argument: no argument
Run the fastrouter in cheap mode (do not respond to requests unless a node is available).
Argument: corerouter ss
Add a Subscription Server to the fastrouter to build the hostname:address map. .. :seealso:: :doc:`SubscriptionServer`
Argument: number
Set the internal fastrouter timeout.
Argument: number
Enable fastrouter post buffering.
Argument: string
Put fastrouter buffered files to the specified directory.
Argument: string
Run the fastrouter stats server.
Argument: number
Enable fastrouter harakiri.
.. seealso:: :doc:`HTTP`
Argument: address
Enable the embedded HTTP router/server/gateway/loadbalancer/proxy on the specified address.
Argument: number
Set the number of http processes to spawn.
Argument: string
Add a key=value item to the generated uwsgi packet.
This option may be declared multiple times.
Argument: string
Forward requests to the specified node (you can specify it multiple time for lb).
This option may be declared multiple times.
Argument: corerouter zerg
Attach the http router to a zerg server.
Argument: string
Fallback to the specified node in case of error.
This option may be declared multiple times.
Argument: number
Set uwsgi protocol modifier1.
Argument: no argument
Use uWSGI cache as key->value virtualhost mapper.
Argument: corerouter use pattern
Use the specified pattern for mapping requests to unix sockets.
Argument: corerouter use base
Use the specified base for mapping requests to unix sockets.
Argument: no argument
Load balance to nodes subscribed to the cluster.
Argument: number
Set the number of concurrent http async events.
Argument: corerouter ss
Enable the SubscriptionServer for clustering and massive hosting/load-balancing.
Argument: number
Set internal http socket timeout.
Argument: no argument
Manage the Expect HTTP request header.
Argument: no argument
Support HTTP keepalive (non-pipelined) requests (requires backend support).
Argument: no argument
Blindly send HTTP body to backends (required for WebSockets and Icecast support).
Argument: corerouter cs
Use code string as hostname->server mapper for the http router.
Argument: optional corerouter use socket
Forward request to the specified uwsgi socket.
Argument: number
Retry connections to dead static nodes after the specified amount of seconds.
Argument: no argument
Do not report failed connections to instances.
Argument: no argument
Run the http router in cheap mode.
Argument: string
Run the http router stats server.
Argument: number
Enable http router harakiri.
.. seealso:: :doc:`HTTPS`
Argument: https config
Add an https router/server on the specified address with specified certificate and key.
Argument: no argument
Export uwsgi variable HTTPS_CC containing the raw client certificate.
Argument: address
Add an HTTP router/server on the specified address and redirect all of the requests to HTTPS.
.. seealso:: :doc:`JVM`
Argument: string
Load the specified class.
Argument: string
Add the specified directory to the classpath.
This option may be declared multiple times.
.. seealso:: :doc:`Lua`
Argument: string
Load lua wsapi app.
.. seealso:: :doc:`Nagios`
Argument: no argument
Output Nagios-friendly status check information.
.. seealso:: :doc:`PAM`
Argument: string
Set the pam service name to use.
Argument: string
Set a fake user for pam.
.. seealso:: :doc:`Perl`
Argument: string
Load a psgi app.
Argument: no argument
Do not catch $SIG{__DIE__}.
Argument: string
Set perl locallib path.
.. seealso:: :doc:`PHP`
Argument: php ini
Use this PHP.ini.
Argument: string
Append this (these) php.inis to the first one.
This option may be declared multiple times.
Argument: key=value
Set a php config directive.
This option may be declared multiple times.
Argument: string
Set the file to open (like index.php) when a directory is requested.
This option may be declared multiple times.
Argument: string
Force php DOCUMENT_ROOT.
Argument: string
Add an allowed document root. Only scripts under these directories will be executed.
This option may be declared multiple times.
Argument: string
Add an allowed php file extension. Only scripts ending with these extensions will run.
This option may be declared multiple times.
Argument: string
Force the SERVER_SOFTWARE value reported to PHP.
Argument: string
Run _only_ this file whenever a request to the PHP plugin is made.
Argument: no argument
Dump php config (even if modified via --php-set or append options).
.. seealso:: :doc:`Ping`
Argument: string
Ping specified uwsgi host.
If the ping is successful the process exits with a 0 code, otherwise with a value > 0.
Argument: number Default: 3
Set ping timeout.
The maximum number of seconds to wait before considering a uWSGI instance dead
.. seealso:: :doc:`Python`
Argument: string
Load .wsgi file as the Python application.
Argument: string
Evaluate Python code as WSGI entry point.
Argument: string
Load a WSGI module as the application. The module (sans .py
) must be importable, ie. be in PYTHONPATH
.
This option may be set with -w
from the command line.
Argument: string Default: application
Set default WSGI callable name.
Argument: string
Test a module import.
This option may be set with -J
from the command line.
Argument: string
Set PYTHONHOME/virtualenv.
This option may be set with -H
from the command line.
.. :seealso:: :doc:`Virtualenv`
Argument: string
Set python program name.
Argument: directory/glob
Add directory (or an .egg or a glob) to the Python search path. This can be specified up to 64 times.
This option may be declared multiple times.
Argument: string
Add a python alias module.
This option may be declared multiple times. .. :seealso:: :doc:`PyModuleAlias`
Argument: string
Add a python module alias after uwsgi module initialization.
This option may be declared multiple times.
Argument: string
Import a python module.
This option may be declared multiple times.
Argument: string
Import a python module in all of the processes.
This option may be declared multiple times.
Argument: string
Import a python module in the spooler.
This option may be declared multiple times.
Argument: string
Manually set sys.argv
for python apps.
pyargv="one two three"
will set sys.argv
to ('one', 'two', 'three')
.
Argument: number
Set python optimization level (this may be dangerous for some apps).
This option may be set with -O
from the command line.
Argument: string
Load a paste.deploy config file. .. :seealso:: :doc:`PythonPaste`
Argument: no argument
Enable paste fileConfig logger.
Argument: string
Load a web3 app.
Argument: string
Load a pump app.
Argument: string
Load a wsgi-lite app.
Argument: paste .INI
Load a paste.deploy config file containing uwsgi section.
Argument: paste .INI
Load a paste.deploy config file containing uwsgi section (load loggers too).
Argument: no argument
Force reload of os.environ at each request.
Argument: no argument
Do not import site module.
Argument: no argument
Run an interactive Python shell in the uWSGI environment.
Argument: no argument
Run an interactive Python shell in the uWSGI environment (one-shot variant).
Argument: .py file
Run a Python script in the uWSGI environment.
Argument: string
Enable the uWSGI Python tracebacker.
Argument: number
Monitor Python modules' modification times to trigger reload (use only in development).
Argument: string
Ignore the specified module during auto-reload scan.
This option may be declared multiple times.
Argument: string
Set the strategy for allocating/deallocating the WSGI env.
Argument: no argument
Send WSGI http headers as soon as possible (PEP violation).
.. seealso:: :doc:`Rawrouter`
Argument: corerouter
Run the rawrouter on the specified port.
Argument: number
Prefork the specified number of rawrouter processes.
Argument: corerouter zerg
Attach the rawrouter to a zerg server.
Argument: no argument
Use uWSGI cache as address->server mapper for the rawrouter.
Argument: corerouter use pattern
Use a pattern for rawrouter address->server mapping.
Argument: corerouter use base
Use a base dir for rawrouter address->server mapping.
Argument: string
Fallback to the specified node in case of error.
This option may be declared multiple times.
Argument: no argument
Load balance to nodes subscribed to the cluster.
Argument: corerouter cs
Use code string as address->server mapper for the rawrouter.
Argument: optional corerouter use socket
Forward request to the specified uwsgi socket.
Argument: string
Forward requests to the specified uwsgi server (you can specify it multiple times for load balancing).
This option may be declared multiple times.
Argument: number
Retry connections to dead static nodes after the specified amount of seconds.
Argument: number
Set the maximum number of concurrent events.
Argument: no argument
Do not report failed connections to instances.
Argument: no argument
Run the rawrouter in cheap mode.
Argument: corerouter ss
Run the rawrouter subscription server on the spcified address.
Argument: number
Set rawrouter timeout.
Argument: string
Run the rawrouter stats server.
Argument: number
Enable rawrouter harakiri.
.. seealso:: :doc:`RRDtool`
Argument: string
Collect request data in the specified rrd file.
This option may be declared multiple times.
Argument: number
Set collect frequency.
Argument: number
Set maximum number of data sources.
.. seealso:: :doc:`Ruby`
Argument: string
Load a Ruby on Rails <= 2.x app.
Argument: string
Load a Rack app.
Argument: number
Set Ruby GC frequency.
Argument: string
Import/require a Ruby module/script.
This option may be declared multiple times.
Argument: string
Import/require a Ruby module/script (shared).
This option may be declared multiple times.
Argument: string
Load the specified gemset (rvm).
Argument: string
Search for rvm in the specified directory.
This option may be declared multiple times.
Argument: optional no argument
Run a Ruby/irb shell.
Argument: number
Set the number of Ruby threads to run (Ruby 1.9+).