UWSGI_EMPEROR_PG(1)
๐ UWSGI_EMPEROR_PG โ the manual, but make it slay โจ
okay so bestie, welcome to the uwsgi_emperor_pg(1) manual page. this is a User Command, and honestly? it's giving legend behaviour. no cap. let me walk you through it like we're texting at 2am and i'm obsessed with this tool. ๐ซถ
โจ NAME โจ
uwsgi_emperor_pg โ a fast (pure C, she's native fr fr), self-healing, developer-friendly WSGI server. periodt. ๐
๐ SYNOPSIS ๐
uwsgi-core [options...]
that's it. that's the whole vibe. you run uwsgi-core and then sprinkle options on top like glitter. ๐
๐ DESCRIPTION ๐
okay this part is LONG so grab a snack ๐. it's basically a giant list of every option she accepts, and bestie, she accepts a lot. each one is a little gift. let's go.
-s,--socketโ bind to the specified UNIX/TCP socket using the default protocol. lowkey the intro option, the main character energy of sockets. โจ-s,--uwsgi-socketโ bind to the specified UNIX/TCP socket, but this time using the uwsgi protocol. yes she shares the short flag, that's just how she is. ๐--suwsgi-socketโ bind to the specified UNIX/TCP socket using the uwsgi protocol over SSL. secure AND slaying. ๐--ssl-socketโ bind to the specified UNIX/TCP socket using the uwsgi protocol over SSL. same energy, different flag name, iconic.--http-socketโ bind to the specified UNIX/TCP socket using the HTTP protocol. the classic. the original. we love her. ๐--http-socket-modifier1โ force the specifiedmodifier1when using HTTP protocol. you decide the number, she obeys. no questions. ๐ฏ--http-socket-modifier2โ force the specifiedmodifier2when using HTTP protocol. twin of the above, equally valid. ๐--http11-socketโ bind to the specified UNIX/TCP socket using HTTP 1.1 (Keep-Alive) protocol. she stays connected, she's loyal fr fr.--https-socketโ bind to the specified UNIX/TCP socket using HTTPS protocol. locked down and gorgeous. ๐--https-socket-modifier1โ force the specifiedmodifier1when using HTTPS protocol. modifier magic โจ--https-socket-modifier2โ force the specifiedmodifier2when using HTTPS protocol. the sequel. ๐ฌ--fastcgi-socketโ bind to the specified UNIX/TCP socket using FastCGI protocol. fast AND CGI. she's efficient okay ๐ญ--fastcgi-nph-socketโ bind to the specified UNIX/TCP socket using FastCGI protocol in nph mode. nph stands for non-parsed headers, and that's just facts, not me guessing. ๐ง--fastcgi-modifier1โ force the specifiedmodifier1when using FastCGI protocol.--fastcgi-modifier2โ force the specifiedmodifier2when using FastCGI protocol.--scgi-socketโ bind to the specified UNIX/TCP socket using SCGI protocol. another protocol, another slay. ๐ธ--scgi-nph-socketโ bind to the specified UNIX/TCP socket using SCGI protocol in nph mode. same nph situation as above.--scgi-modifier1โ force the specifiedmodifier1when using SCGI protocol.--scgi-modifier2โ force the specifiedmodifier2when using SCGI protocol.--raw-socketโ bind to the specified UNIX/TCP socket using RAW protocol. raw. unfiltered. honest. she's not like other sockets. ๐--raw-modifier1โ force the specifiedmodifier1when using RAW protocol.--raw-modifier2โ force the specifiedmodifier2when using RAW protocol.--puwsgi-socketโ bind to the specified UNIX/TCP socket using persistent uwsgi protocol (puwsgi). she persists. obviously. ๐--protocolโ force the specified protocol for default sockets. you're in charge of the vibe check here.--socket-protocolโ force the specified protocol for default sockets. same energy, twin flag. ๐ซถ--shared-socketโ create a shared socket for advanced jailing or ipc. for when things get โจadvancedโจ.--undeferred-shared-socketโ create a shared socket for advanced jailing or ipc, but in undeferred mode. the non-deferred remix. ๐ง-p,--processesโ spawn the specified number of workers/processes. how many besties you want on the job.-p,--workersโ spawn the specified number of workers/processes. yes, this shares the-pflag with--processes. they're twins. deal with it. ๐--thunder-lockโ serializeaccept()usage (if possible). thunder. lock. dramatic AND functional. โก-t,--harakiriโ set the harakiri timeout. if a request is taking too long, she ends it. respectfully. ๐ก๏ธ--harakiri-verboseโ enable verbose mode for harakiri. so when she takes the sword, she narrates it. ๐--harakiri-graceful-timeoutโ the interval between a graceful harakiri attempt and asigkill. so like, she asks nicely first, then it gets real.--harakiri-graceful-signalโ use this signal instead ofsigtermfor graceful harakiri attempts. you pick the signal, she uses it.--harakiri-queue-thresholdโ only trigger harakiri if the queue is greater than this threshold. so she only gets dramatic when the queue is actually struggling. ๐--harakiri-no-arhโ do not enable harakiri duringafter-request-hook. give the hook some space bestie.--no-harakiri-arhโ do not enable harakiri duringafter-request-hook. same as above, different spelling, both valid. โจ--no-harakiri-after-req-hookโ do not enable harakiri duringafter-request-hook. trio of twin flags because she's extra like that. ๐--backtrace-depthโ set the backtrace depth. for when you need to see how deep the drama really goes. ๐--mule-harakiriโ set the harakiri timeout for mule tasks. the mules get their own harakiri rules. iconic. ๐ด-x,--xmlconfigโ load config from an xml file. old school but still cute. ๐-x,--xmlโ load config from xml file. same thing, she has two names, she's mysterious. ๐--configโ load configuration using the pluggable system. flexible queen. ๐--fallback-configโ re-execuwsgiwith the specified config when exit code is 1. a backup plan, because she plans ahead. ๐--strictโ enable strict mode. important caveat: placeholder cannot be used in strict mode. so fr fr, no placeholders. ๐ซ--skip-zeroโ skip the check of file descriptor 0. just skipping it. no thoughts. ๐ธ--skip-atexitโ skip atexit hooks (this is ignored by the master). the master is unbothered. ๐--skip-atexit-teardownโ skip atexit teardown (also ignored by the master). she's consistent about not listening to the master on this. ๐-S,--setโ set a placeholder or an option. versatile much? โจ--set-placeholderโ set a placeholder. specific mode unlocked. ๐ฏ--set-phโ set a placeholder. yes this is the same as above, she has nicknames, let her live. ๐ฆ--getโ print the specified option value and exit. short and to the point, we love a clean exit. ๐ช--declare-optionโ declare a new uWSGI custom option. you can make your own options now. main character move tbh. ๐--declare-option2โ declare a new uWSGI custom option, but non-immediate. the chill delayed version. ๐ค--resolveโ place the result of a dns query in the specified placeholder. syntax is:placeholder=nameโ and btw it's an immediate option. (the original manual typo'd it as "sytax", i'm just fixing the spelling for readability, the meaning is identical ๐ซถ)--forโ(opt logic)for cycle. logic time bestie. ๐--for-globโ(opt logic)for cycle, but expand the glob. patterns get matched, magic happens. โจ--for-timesโ(opt logic)for cycle, expanding the specified num to a list starting from1. so if you say 5, you get 1 2 3 4 5. ๐--for-readlineโ(opt logic)for cycle, expanding the specified file to a list of lines. ๐--endforโ(opt logic)end for cycle. closing the loop, respectfully. ๐--end-forโ(opt logic)end for cycle. same energy, different spelling. ๐--if-optโ(opt logic)check for option. conditional queen. ๐--if-not-optโ(opt logic)check for option (the inverse vibe). ๐--if-envโ(opt logic)check for an environment variable. ๐ฑ--if-not-envโ(opt logic)check for environment variable (not-version). โจ--ifenvโ(opt logic)check for environment variable. third name for the same thing, she's just like that. ๐--if-reloadโ(opt logic)check for reload. did she just reload? check it. ๐--if-not-reloadโ(opt logic)check for reload (the not-version). ๐--if-hostnameโ(opt logic)check for hostname. who are you, machine? ๐--if-not-hostnameโ(opt logic)check for hostname (not-version). ๐ซ--if-hostname-matchโ(opt logic)try to match hostname against a regular expression. regex girlies rise up. ๐ง--if-not-hostname-matchโ(opt logic)try to match hostname against a regular expression (not-version). ๐ช--if-existsโ(opt logic)check for file/directory existence. does it exist? check. ๐--if-not-existsโ(opt logic)check for file/directory existence (not-version). ๐ป--ifexistsโ(opt logic)check for file/directory existence. yes, another nickname, keep up. ๐--if-pluginโ(opt logic)check for plugin. does the plugin exist? ๐--if-not-pluginโ(opt logic)check for plugin (not-version). ๐ซ--ifpluginโ(opt logic)check for plugin. the third twin. ๐--if-fileโ(opt logic)check for file existence specifically. ๐--if-not-fileโ(opt logic)check for file existence (not-version). ๐ธ--if-dirโ(opt logic)check for directory existence specifically. ๐--if-not-dirโ(opt logic)check for directory existence (not-version). ๐ฆ--ifdirโ(opt logic)check for directory existence. yes, again, a nickname. she has SO many. ๐ญ--if-directoryโ(opt logic)check for directory existence. fourth one for this exact check, bestie, i'm not joking. ๐--endifโ(opt logic)end if. close the conditional. ๐--end-ifโ(opt logic)end if. twin. โจ--blacklistโ set options blacklist context. spicy permissions move. ๐ค--end-blacklistโ clear options blacklist context. undo. ๐งน--whitelistโ set options whitelist context. the opposite vibe, but equally valid. ๐ค--end-whitelistโ clear options whitelist context. undo again. ๐งผ--ignore-sigpipeโ do not report the (annoying)SIGPIPE. silence is golden fr fr. ๐คซ--ignore-write-errorsโ do not report the (also annoying)write()/writev()errors. peace and quiet. ๐๏ธ--write-errors-toleranceโ set the maximum number of allowed write errors. default is no tolerance. so by default, she does NOT play. important caveat!! โ ๏ธ--write-errors-exception-onlyโ only raise an exception on write errors, giving control to the app itself. let the app handle its own drama. ๐ญ--disable-write-exceptionโ disable exception generation onwrite()/writev(). no exceptions, periodt. ๐ซ--inheritโ use the specified file as a config template. ๐--includeโ include the specified file as immediate configuration. โก--inject-beforeโ inject a text file before the config file (advanced templating). ๐--inject-afterโ inject a text file after the config file (advanced templating). ๐-d,--daemonizeโ daemonizeuWSGI. she becomes one with the background. ๐--daemonize2โ daemonizeuWSGIafter app loading. fashionably late to the background. โฐ--stopโ stop an instance. bye bestie ๐--reloadโ reload an instance. refresh her. ๐--pauseโ pause an instance. hold that thought. โ--suspendโ suspend an instance. deeper pause energy. ๐ค--resumeโ resume an instance. she's back and better. ๐--connect-and-readโ connect to a socket and wait for data from it. patient queen. โณ--extractโ fetch/dump any supported address to stdout. dump it, bestie. ๐ค-l,--listenโ set the socket listen queue size. how many can wait in line. ๐ฆ-v,--max-varsโ set the amount of internal iovec/vars structures. variable vibes only. ๐๏ธ--max-appsโ set the maximum number of per-worker applications. how many apps per worker. ๐-b,--buffer-sizeโ set internal buffer size. size matters here. ๐-m,--memory-reportโ enable memory report. receipts for your RAM. ๐งพ--profilerโ enable the specified profiler. performance girlies, get in. ๐-c,--cgi-modeโ force CGI-mode for plugins supporting it. retro but make it cute. ๐ผ-a,--abstract-socketโ force UNIX socket in abstract mode (Linux only). linux besties only on this one. ๐ง-C,--chmod-socketโchmod-socket. set those perms. ๐-C,--chmodโchmod-socket. same thing, shorter name. ๐--chown-socketโ chown unix sockets. change the owner, change the vibe. ๐ค--umaskโ set umask. classic unix move. ๐ญ--freebindโ put socket in freebind mode. she roams free. ๐ฆ--map-socketโ map sockets to specific workers. assignments, bestie. ๐บ๏ธ-T,--enable-threadsโ enable threads. stub option btw: this is true by default. so it's already true, she's just giving you the option to say it out loud. ๐งต--no-threads-waitโ do not wait for threads cancellation on quit/reload. she's not waiting. ๐ช--auto-procnameโ automatically set process names to something meaningful. she names herself. ๐--procname-prefixโ add a prefix to the process names. ๐--procname-prefix-spacedโ add a spaced prefix to the process names. the space is the moment. โจ--procname-appendโ append a string to process names. ๐--procnameโ set process names. the whole thing. ๐--procname-masterโ set master process name. master gets her own name. ๐ธ-i,--single-interpreterโ do not use multiple interpreters (where available). one interpreter, one vibe. ๐ฏ--need-appโ exit if no app can be loaded. she needs the app fr fr. no app, no service. ๐ช-M,--masterโ enable master process. the boss is here. ๐--honour-stdinโ do not remap stdin to/dev/null. respect the stdin. ๐ค--emperorโ run the Emperor. yes, she's royalty. she runs everything. ๐โจ--emperor-proxy-socketโ force the vassal to become an Emperor proxy. vassals with main character energy. ๐ญ--emperor-wrapperโ set a binary wrapper for vassals. wrapping them up nice. ๐--emperor-wrapper-overrideโ set a binary wrapper for vassals to try before the default one. priority wrapper. ๐ฅ--emperor-wrapper-fallbackโ set a binary wrapper for vassals to try as a last resort. backup wrapper, just in case. ๐--emperor-nofollowโ do not follow symlinks when checking for mtime. symlinks stay unbothered. ๐--emperor-procnameโ set the Emperor process name. name the royalty. ๐--emperor-freqโ set the Emperor scan frequency. default is 3 seconds. so she scans every 3 seconds, no cap. โฑ๏ธ--emperor-required-heartbeatโ set the Emperor tolerance about heartbeats. how forgiving she is about heartbeats. ๐--emperor-curse-toleranceโ set the Emperor tolerance about cursed vassals. how much cursed behaviour she tolerates. ๐ง
okay that's the end of part 1 bestie, more is coming ๐ซถโจ
--emperor-pidfileโ drops the Emperor's pid into the file you name, so you can find your ruler later ๐--emperor-tyrantโ flips the Emperor into Tyrant mode ๐ซ no cap, it does not play--emperor-tyrant-nofollowโ in Tyrant mode, don't follow symlinks when it's checking uid/gid. no sneaky shortcuts, bestie ๐ซ๐--emperor-statsโ spins up the Emperor stats server โจ--emperor-stats-serverโ same vibe, spins up the Emperor stats server โจ--early-emperorโ spawns the emperor ASAP, like, the second it can ๐ค--emperor-broodlordโ runs the emperor in BroodLord mode ๐--emperor-throttleโ sets the throttling level (in milliseconds) for vassals that are acting up (default1000) ๐ซ--emperor-max-throttleโ sets the max throttling level (in milliseconds) for bad-behaving vassals (default3 minutes) ๐ญ--emperor-magic-execโ prefixes vassals' config files withexec://if they've got the executable bit set ๐ช--emperor-on-demand-extensionโ searches for a text file (vassal name + extension) that holds the on demand socket name ๐--emperor-on-demand-extโ literally the same thing, searches for that text file (vassal name + extension) with the on demand socket name ๐--emperor-on-demand-directoryโ turns on on demand mode, binding to the unix socket in the directory you give, named like the vassal +.socket๐--emperor-on-demand-dirโ same energy: on demand mode, unix socket in your directory, named like the vassal +.socket๐--emperor-on-demand-execโ uses the output of the command you specify as the on demand socket name (the vassal name gets passed as the only argument) ๐ฏ--emperor-extra-extensionโ lets the Emperor accept that extension (the vassal gets called with--config) ๐ง--emperor-extra-extโ again, allows that extension in the Emperor (vassal called with--config) ๐ง--emperor-no-blacklistโ disables the Emperor blacklisting subsystem ๐--emperor-use-cloneโ usesclone()instead offork(), passing theunshare()flags you specify ๐งฌ--emperor-graceful-shutdownโ uses vassals graceful shutdown during ragnarok ๐ yes, ragnarok, that's the word--emperor-capโ sets vassals' capability ๐ฉ--vassals-capโ sets vassals' capability ๐ฉ--vassal-capโ sets vassals' capability ๐ฉ--imperial-monitor-listโ lists the enabled imperial monitors ๐--imperial-monitors-listโ lists the enabled imperial monitors ๐--vassals-inheritโ adds config templates to vassals' config (it uses--inherit) ๐ซถ--vassals-includeโ includes config templates in vassals' config (uses--includeinstead of--inherit) ๐ซถ--vassals-inherit-beforeโ adds config templates to vassals' config (uses--inherit, and parses before the vassal file) โฎ๏ธ--vassals-include-beforeโ includes config templates in vassals' config (uses--includeinstead of--inherit, and parses before the vassal file) โฎ๏ธ--vassals-start-hookโ runs the command you give before each and every vassal starts ๐--vassals-stop-hookโ runs the command you give after a vassal's death โฐ๏ธ--vassal-sosโ the vassal asks the emperor for reinforcement when it's overloaded ๐--vassal-sos-backlogโ the vassal fires off an sos if the backlog queue has more items than the value you set ๐--vassals-setโ automatically sets the option you name (via--set) for every vassal โ๏ธ--vassal-setโ automatically sets that option (via--set) for every vassal โ๏ธ--heartbeatโ announces healthiness to the emperor ๐--reload-mercyโ sets the max time (in seconds) we wait for workers and other processes to die during reload/shutdown โณ--worker-reload-mercyโ sets the max time (in seconds) a worker gets to reload/shutdown (default is60) โณ--mule-reload-mercyโ sets the max time (in seconds) a mule gets to reload/shutdown (default is60) โณ--exit-on-reloadโ forces an exit even if a reload was requested ๐ช--die-on-termโ exits instead of doing a brutal reload onSIGTERM๐--force-gatewayโ forces the spawn of the first registered gateway with no master ๐ฅ-h|--helpโ shows this help ๐-h|--usageโ shows this help ๐--print-symโ prints the content of the binary symbol you specify ๐--print-symbolโ prints the content of that binary symbol ๐-r|--reaperโ callswaitpid(-1,...)after each request to get rid of zombies ๐ง no zombie apocalypse, not today-R|--max-requestsโ reloads workers after the specified amount of managed requests ๐--max-requests-deltaโ adds(worker_id * delta)to themax_requestsvalue of each worker โ--min-worker-lifetimeโ the number of seconds a worker has to run before it can be reloaded (default is10) โฑ๏ธ--max-worker-lifetimeโ reloads workers after the specified amount of seconds (default is disabled) โฑ๏ธ--max-worker-lifetime-deltaโ adds(worker_id * delta)seconds to themax_worker_lifetimevalue of each worker โ-z|--socket-timeoutโ sets the internal sockets timeout ๐--no-fd-passingโ disables file descriptor passing ๐ซ--locksโ creates the number of shared locks you specify ๐--lock-engineโ sets the lock engine ๐ง--ftokโ sets the ipcsem key viaftok()so you avoid duplicates ๐๏ธ--persistent-ipcsemโ does not remove ipcsem's on shutdown ๐ซฅ they stay-A|--sharedareaโ creates a raw shared memory area of the number of pages you give (heads up: it supports keyval too) ๐ง--safe-fdโ does not close the file descriptor you specify ๐--fd-safeโ does not close that file descriptor ๐--cacheโ creates a shared cache holding the given elements ๐ฐ--cache-blocksizeโ sets the cache blocksize ๐งฑ--cache-storeโ enables persistent cache to disk ๐พ--cache-store-syncโ sets the frequency of sync for the persistent cache ๐--cache-no-expireโ disables the auto sweep of expired items ๐งน๐ซ--cache-expire-freqโ sets how often the cache sweeper scans (default3 seconds) ๐งฝ--cache-report-freed-itemsโ constantly reports the cache item freed by the sweeper (use only for debug, bestie) ๐--cache-udp-serverโ binds the cache udp server (used only for set/update/delete) to the socket you specify ๐ก--cache-udp-nodeโ sends cache update/deletion to the cache udp server you specify ๐ค--cache-syncโ copies the whole content of another uWSGI cache server on server startup ๐ฅ--cache-use-last-modifiedโ updates thelast_modified_attimestamp on every cache item modification (default is disabled) ๐ฐ๏ธ--add-cache-itemโ adds an item in the cache โ--load-file-in-cacheโ loads a static file into the cache ๐--load-file-in-cache-gzipโ loads a static file into the cache with gzip compression ๐๏ธ--cache2โ creates a new generation shared cache (keyval syntax) ๐ฑ--queueโ enables the shared queue ๐ถโโ๏ธ๐ถโโ๏ธ๐ถโโ๏ธ--queue-blocksizeโ sets the queue blocksize ๐งฑ--queue-storeโ enables persistent queue to disk ๐พ--queue-store-syncโ sets the frequency of sync for the persistent queue ๐-Q|--spoolerโ runs a spooler on the directory you specify ๐๏ธ--spooler-externalโ maps spooler requests to a spooler directory managed by an external instance ๐--spooler-orderedโ tries to order the execution of spooler tasks ๐ข--spooler-chdirโ does achdir()to the specified directory before each spooler task ๐ช--spooler-processesโ sets the number of processes for spoolers ๐ฏ--spooler-quietโ don't be verbose with spooler tasks ๐คซ--spooler-max-tasksโ sets the max number of tasks to run before a spooler gets recycled โป๏ธ--spooler-harakiriโ sets the harakiri timeout for spooler tasks ๐ก๏ธ--spooler-frequencyโ sets the spooler frequency โฒ๏ธ--spooler-freqโ sets the spooler frequency โฒ๏ธ--muleโ adds a mule ๐ด--mulesโ adds the number of mules you specify ๐ด๐ด๐ด--farmโ adds a mule farm ๐--mule-msg-sizeโ sets the mule message buffer size ๐ฆ--signalโ sends a uwsgi signal to a server ๐ถ--signal-bufsizeโ sets the buffer size for the signal queue ๐--signals-bufsizeโ sets the buffer size for the signal queue ๐--signal-timerโ adds a timer (syntax:<signal> <seconds>) โฐ--timerโ adds a timer (syntax:<signal> <seconds>) โฐ--signal-rbtimerโ adds a redblack timer (syntax:<signal> <seconds>) ๐ณโฐ--rbtimerโ adds a redblack timer (syntax:<signal> <seconds>) ๐ณโฐ--rpc-maxโ the maximum number of rpc slots (default:64) ๐ฐ-L|--disable-loggingโ disables request logging ๐--flockโ locks the specified file before starting, and exits if it's locked ๐--flock-waitโ locks the specified file before starting, and waits if it's locked โธ๏ธ--flock2โ locks the specified file after logging/daemon setup, exits if it's locked ๐--flock-wait2โ locks the specified file after logging/daemon setup, waits if it's locked โธ๏ธ--pidfileโ creates a pidfile (before privileges drop) ๐--pidfile2โ creates a pidfile (after privileges drop) ๐--safe-pidfileโ creates a safe pidfile (before privileges drop) ๐--safe-pidfile2โ creates a safe pidfile (after privileges drop) ๐--chrootโ does achroot()to the directory you specify ๐ฆ--pivot-rootโ does apivot_root()to the directories you specify (new_rootandput_oldmust be separated with a space) ๐--pivot_rootโ does apivot_root()to those directories (new_rootandput_oldseparated with a space) ๐--uidโ does asetuidto the user/uid you specify ๐ค--gidโ does asetgidto the group/gid you specify ๐ฅ--add-gidโ adds the group id you specify to the process credentials โ--immediate-uidโsetuidto the user/uid you specify, but IMMEDIATELY โก--immediate-gidโsetgidto the group/gid you specify, IMMEDIATELY โก--no-initgroupsโ disables the additional groups that get set viainitgroups()๐ซ--capโ sets the process capability ๐ฉ--unshareโunshare()s part of the processes and drops them in a new namespace ๐ช--unshare2โ same thing,unshare()s part of the processes into a new namespace โ but after the rootfs change ๐ช--setns-socketโ exposes a unix socket that returns namespace fds from/proc/self/ns๐--setns-socket-skipโ skips the entry you specify when sending setns file descriptors โญ๏ธ--setns-skipโ skips that entry when sending setns file descriptors โญ๏ธ--setnsโ joins a namespace created by an external uWSGI instance ๐ช--setns-preopenโ opens/proc/self/nsas soon as possible and caches the fds โก--jailedโ marks this instance as jailed, which forces thepost_jailhooks to actually run. it's giving "yes i am in the box, treat me like it" ๐--reforkโ does afork()again after the privileges drop. super handy for jailing systems โจ--re-forkโ literally the same thing as--refork, just spelled the other way. fork() again after privileges drop, jailing systems, you know the drill ๐ฆ--refork-as-rootโfork()again, but before the privileges drop this time. again, for jailing systems ๐--re-fork-as-rootโ the hyphenated twin of--refork-as-root. fork() again before privileges drop, useful for jailing systems ๐ธ--refork-post-jailโfork()again after jailing. jailing systems again bestie, we love them ๐--re-fork-post-jailโ yep, same as--refork-post-jail, extra hyphen edition. fork() again after jailing, useful for jailing systems ๐
--hook-asapโ runs the specified hook as soon as possible โก--hook-pre-jailโ runs the specified hook before jailing--hook-post-jailโ runs the specified hook after jailing--hook-in-jailโ runs the specified hook in jail after initialization ๐--hook-as-rootโ runs the specified hook before the privileges drop ๐--hook-as-userโ runs the specified hook after the privileges drop ๐--hook-as-user-atexitโ runs the specified hook before app exit and reload ๐ญ--hook-pre-appโ runs the specified hook before app loading--hook-post-appโ runs the specified hook after app loading--hook-post-forkโ runs the specified hook after each fork ๐ด--hook-acceptingโ runs the specified hook after each worker enters the accepting phase ๐--hook-accepting1โ runs the specified hook after the first worker enters the accepting phase ๐ฅ--hook-accepting-onceโ runs the specified hook after each worker enters the accepting phase, but only once per-instance โจ--hook-accepting1-onceโ runs the specified hook after the first worker enters the accepting phase, and only once per instance ๐--hook-master-startโ runs the specified hook when the Master starts ๐--hook-touchโ runs the specified hook when the specified file is touched. syntax is<file> <action>๐ซฐ--hook-emperor-startโ runs the specified hook when the Emperor starts ๐--hook-emperor-stopโ runs the specified hook when the Emperor sends a stop message ๐--hook-emperor-reloadโ runs the specified hook when the Emperor sends a reload message ๐--hook-emperor-lostโ runs the specified hook when the Emperor connection is lost ๐--hook-as-vassalโ runs the specified hook beforeexec()ing the vassal--hook-as-emperorโ runs the specified hook in the emperor after the vassal has been started--hook-as-muleโ runs the specified hook in each mule ๐ด--hook-as-gatewayโ runs the specified hook in each gateway ๐
--after-request-hookโ runs the specified function/symbol after each request ๐ซ--after-request-callโ runs the specified function/symbol after each request (same energy fr fr)
--exec-asapโ runs the specified command as soon as possible โก--exec-pre-jailโ runs the specified command before jailing--exec-post-jailโ runs the specified command after jailing--exec-in-jailโ runs the specified command in jail after initialization ๐--exec-as-rootโ runs the specified command before the privileges drop ๐--exec-as-userโ runs the specified command after the privileges drop ๐--exec-as-user-atexitโ runs the specified command before app exit and reload ๐ญ--exec-pre-appโ runs the specified command before app loading--exec-post-appโ runs the specified command after app loading--exec-as-vassalโ runs the specified command beforeexec()ing the vassal--exec-as-emperorโ runs the specified command in the emperor after the vassal has been started
--mount-asapโ mounts filesystem as soon as possible โก--mount-pre-jailโ mounts filesystem before jailing--mount-post-jailโ mounts filesystem after jailing--mount-in-jailโ mounts filesystem in jail after initialization ๐--mount-as-rootโ mounts filesystem before the privileges drop ๐--mount-as-vassalโ mounts filesystem beforeexec()ing the vassal--mount-as-emperorโ mounts filesystem in the emperor after the vassal has been started
--umount-asapโ unmounts filesystem as soon as possible โก--umount-pre-jailโ unmounts filesystem before jailing--umount-post-jailโ unmounts filesystem after jailing--umount-in-jailโ unmounts filesystem in jail after initialization ๐--umount-as-rootโ unmounts filesystem before the privileges drop ๐--umount-as-vassalโ unmounts filesystem beforeexec()ing the vassal--umount-as-emperorโ unmounts filesystem in the emperor after the vassal has been started
--wait-for-interfaceโ waits for the specified network interface to come up before running root hooks ๐ก--wait-for-interface-timeoutโ sets the timeout forwait-for-interfaceโฑ๏ธ--wait-interfaceโ waits for the specified network interface to come up before running root hooks (same thing, shorter name)--wait-interface-timeoutโ sets the timeout forwait-for-interfaceโฑ๏ธ--wait-for-ifaceโ waits for the specified network interface to come up before running root hooks ๐--wait-for-iface-timeoutโ sets the timeout forwait-for-interfaceโฑ๏ธ--wait-ifaceโ waits for the specified network interface to come up before running root hooks โจ--wait-iface-timeoutโ sets the timeout forwait-for-interfaceโฑ๏ธ--wait-for-fsโ waits for the specified filesystem item to appear before running root hooks ๐--wait-for-fileโ waits for the specified file to appear before running root hooks ๐--wait-for-dirโ waits for the specified directory to appear before running root hooks ๐--wait-for-mountpointโ waits for the specified mountpoint to appear before running root hooks ๐ฝ--wait-for-fs-timeoutโ sets the timeout forwait-for-fs/file/dirโฑ๏ธ--wait-for-socketโ waits for the specified socket to be ready before loading apps ๐--wait-for-socket-timeoutโ sets the timeout forwait-for-socketโฑ๏ธ
--call-asapโ calls the specified function as soon as possible โก--call-pre-jailโ calls the specified function before jailing--call-post-jailโ calls the specified function after jailing--call-in-jailโ calls the specified function in jail after initialization ๐--call-as-rootโ calls the specified function before the privileges drop ๐--call-as-userโ calls the specified function after the privileges drop ๐--call-as-user-atexitโ calls the specified function before app exit and reload ๐ญ--call-pre-appโ calls the specified function before app loading--call-post-appโ calls the specified function after app loading--call-as-vassalโ calls the specifiedfunction()beforeexec()ing the vassal--call-as-vassal1โ calls the specifiedfunction(char *)beforeexec()ing the vassal--call-as-vassal3โ calls the specifiedfunction(char *, uid_t, gid_t)beforeexec()ing the vassal--call-as-emperorโ calls the specifiedfunction()in the emperor after the vassal has been started--call-as-emperor1โ calls the specifiedfunction(char *)in the emperor after the vassal has been started--call-as-emperor2โ calls the specifiedfunction(char *, pid_t)in the emperor after the vassal has been started--call-as-emperor4โ calls the specifiedfunction(char *, pid_t, uid_t, gid_t)in the emperor after the vassal has been started
--iniโ load config from an ini file ๐-y,--yamlโ load config from a yaml file ๐ธ-y,--ymlโ load config from a yaml file (same short flag, same vibe)-j,--jsonโ load config from a json file ๐งพ-j,--jsโ load config from a json file (again,-jdoes both)
--weightโ the weight of the instance. it's used by clustering/lb/subscriptions โ๏ธ--auto-weightโ sets the weight of the instance automatically, also used by clustering/lb/subscriptions โจ--no-serverโ forces no-server mode ๐ซ--command-modeโ forces command mode โจ๏ธ--no-defer-acceptโ disables deferred-accept on sockets ๐--tcp-nodelayโ enables TCP NODELAY on each request โก--so-keepaliveโ enables TCP KEEPALIVEs ๐--so-send-timeoutโ setsSO_SNDTIMEOโฑ๏ธ--socket-send-timeoutโ setsSO_SNDTIMEO(yes, same one)--so-write-timeoutโ setsSO_SNDTIMEO(yep, stillSO_SNDTIMEO)--socket-write-timeoutโ setsSO_SNDTIMEO(they're all the same bestie, pick your fav name)--socket-sndbufโ setsSO_SNDBUF๐ค--socket-rcvbufโ setsSO_RCVBUF๐ฅ--shutdown-socketsโ forces callingshutdown()in addition toclose()when sockets are destroyed ๐--limit-asโ limits the processes' address space/vsz ๐งฑ--limit-nprocโ limits the number of spawnable processes ๐ง--reload-on-asโ reloads if address space goes higher than the specified megabytes ๐--reload-on-rssโ reloads if rss memory goes higher than the specified megabytes ๐--evil-reload-on-asโ forces the master to reload a worker if its address space is higher than the specified megabytes ๐--evil-reload-on-rssโ forces the master to reload a worker if its rss memory is higher than the specified megabytes ๐--mem-collector-freqโ sets the memory collector frequency when evil reloads are in place ๐งน--reload-on-fdโ reloads if the specified file descriptor is ready ๐ฌ--brutal-reload-on-fdโ brutal reload if the specified file descriptor is ready ๐--ksmโ enables Linux KSM ๐ง--pcre-jitโ enables pcre jit (if available) โก--never-swapโ locks all memory pages, avoiding swapping ๐--touch-reloadโ reloads uWSGI if the specified file is modified/touched ๐--touch-workers-reloadโ triggers a reload of (only) workers if the specified file is modified/touched ๐ ๏ธ--touch-mules-reloadโ reloads mules if the specified file is modified/touched ๐ด--touch-spoolers-reloadโ reloads spoolers if the specified file is modified/touched ๐งต--touch-chain-reloadโ triggers a chain reload if the specified file is modified/touched โ๏ธ--touch-logrotateโ triggers logrotation if the specified file is modified/touched ๐ฆ--touch-logreopenโ triggers log reopen if the specified file is modified/touched ๐--touch-execโ runs a command when the specified file is modified/touched. syntax isfile command๐ป
okay bestie, this next chunk is LONG but it's lowkey the fun stuff โจ filesystem watchers, metrics, stats, legions, subscriptions, ssl, loggersโฆ we got it ALL. hydrate, stretch, let's GO ๐
๐ฆ bestie, let's watch some files (and mountpoints, and touches)
--touch-signalโ pings a signal when the file you point at gets modified/touched. Syntax is literally:file signal--fs-reloadโ graceful reload the moment the filesystem object you named gets modified ๐--fs-brutal-reloadโ same vibe but BRUTAL. no gentle goodbye, just reload when the filesystem object changes ๐--fs-signalโ raise a uwsgi signal when the filesystem object you specified gets modified. Syntax:file signal--check-mountpointโ nukes the instance if a filesystem stops being reachable (super useful for reliable Fuse management, iykyk)--mountpoint-checkโ destroys the instance if a filesystem is no longer reachable (yes bestie, same thing, reliable Fuse management โจ)--check-mountโ destroys the instance if a filesystem is no more reachable (reliable Fuse management energy)--mount-checkโ destroys the instance if a filesystem is no more reachable (reliable Fuse management, again ๐ซถ)--propagate-touchโ an over-engineering option for systems with flaky signal management. yes that's literally what it says ๐
๐ request bodies, orphans & process vibes
--limit-postโ caps the request body. limit her, periodt.--no-orphansโ automatically kills workers if the master dies. can be dangerous for availability, so be careful bestie โ ๏ธ--prioโ set processes/threads priority--cpu-affinityโ set cpu affinity (pin those threads where you want 'em ๐ )--post-bufferingโ set the size in bytes after which it buffers to disk instead of memory--post-buffering-bufsizeโ set the buffer size forread()when you're in post buffering mode--body-read-warningโ sets how many megabytes of memory allocation are allowed for a request body before it starts printing a warning. a lil heads up before things get spicy ๐ฅ--upload-progressโ enables creation of.jsonfiles in the directory you specify, while a file upload is happening ๐
๐ธ app mounting & script name shenanigans
--no-default-appโ do not fallback to the default app--manage-script-nameโ automatically rewritesSCRIPT_NAMEandPATH_INFO--ignore-script-nameโ ignoreSCRIPT_NAMEentirely, no thoughts head empty ๐ญ--catch-exceptionsโ reports the exception as http output. discouraged!! use only for testing ๐--reload-on-exceptionโ reloads a worker whenever an exception is raised--reload-on-exception-typeโ reloads a worker when a specific exception type is raised--reload-on-exception-valueโ reloads a worker when a specific exception value is raised--reload-on-exception-reprโ reloads a worker when a specific exception type+value (language-specific, okurr) is raised--exception-handlerโ add an exception handler
๐ metrics, stats & alarms (the monitoring girlies)
--enable-metricsโ turn the whole metrics subsystem ON--metricโ add a custom metric--metric-thresholdโ add a metric threshold/alarm--metric-alarmโ add a metric threshold/alarm--alarm-metricโ add a metric threshold/alarm--metrics-dirโ export metrics as text files into the directory you name--metrics-dir-restoreโ restore the last value taken from the metrics dir--metric-dirโ export metrics as text files to the specified directory--metric-dir-restoreโ restore last value taken from the metrics dir--metrics-no-coresโ disable generation of cores-related metrics--udpโ run the udp server on the address you specify ๐ก--statsโ enable the stats server on the specified address--stats-serverโ enable the stats server on the specified address (same queen, different name ๐)--stats-httpโ prefix stats server json output with http headers--stats-minifiedโ minify the statistics json output--stats-minโ minify statistics json output--stats-pushโ push the stats json to the destination you specify--stats-pusher-default-freqโ set the default frequency of stats pushers--stats-pushers-default-freqโ set the default frequency of stats pushers--stats-no-coresโ disable generation of cores-related stats--stats-no-metricsโ do not include metrics in the stats output--multicastโ subscribe to the specified multicast group--multicast-ttlโ set multicast ttl--multicast-loopโ set multicast loop (default1)--master-fifoโ enable the master fifo--notify-socketโ enable the notification socket--subscription-notify-socketโ set the notification socket for subscriptions
๐ง the legion section (yes it's really called a legion, iconic)
--legionโ become a member of a legion--legion-mcastโ become a member of a legion (shortcut for multicast)--legion-nodeโ add a node to a legion--legion-freqโ set the frequency of legion packets--legion-toleranceโ set the tolerance of the legion subsystem--legion-death-on-lord-errorโ declares itself as a dead node for the number of seconds you specify if one of the lord hooks fails ๐--legion-skew-toleranceโ set the clock skew tolerance of the legion subsystem (default60seconds)--legion-lordโ the action to call on Lord election--legion-unlordโ the action to call on Lord dismiss--legion-setupโ the action to call on legion setup--legion-deathโ the action to call on legion death (shutdown of the instance)--legion-joinโ the action to call on legion join (first time quorum is reached)--legion-node-joinedโ the action to call on a new node joining the legion--legion-node-leftโ the action to call on a node leaving the legion--legion-quorumโ set the quorum of a legion--legion-scrollโ set the scroll of a legion--legion-scroll-max-sizeโ set the max size of the legion scroll buffer--legion-scroll-list-max-sizeโ set the max size of the legion scroll list buffer
๐ subscriptions, security & signing
--subscriptions-sign-checkโ set the digest algorithm and certificate directory for the secured subscription system--subscriptions-sign-check-toleranceโ set the maximum tolerance (in seconds) of clock skew for the secured subscription system--subscriptions-sign-skip-uidโ skip the signature check for the uid you specify, when using unix sockets credentials--subscriptions-credentials-checkโ add a directory to search for subscriptions key credentials--subscriptions-use-credentialsโ enable management ofSCM_CREDENTIALSin subscriptions UNIX sockets--subscription-algoโ set the load balancing algorithm for the subscription system--subscription-dotsplitโ try to fallback to the next part (dot based) in the subscription key--subscribe-toโ subscribe to the specified subscription server--stโ subscribe to the specified subscription server--subscribeโ subscribe to the specified subscription server--subscribe2โ subscribe to the specified subscription server using advanced keyval syntax--subscribe-freqโ send subscription announce at the interval you set--subscription-toleranceโ set the tolerance for subscription servers--unsubscribe-on-graceful-reloadโ force the unsubscribe request even during a graceful reload--start-unsubscribedโ configure subscriptions but do NOT send them (useful with master fifo)--subscribe-with-modifier1โ force the specifiedmodifier1when subscribing
๐ snmp & ssl (handle with care bestie)
--snmpโ enable the embedded snmp server--snmp-communityโ set the snmp community string--ssl-verboseโ be verbose about SSL errors--ssl-verify-depthโ set the maximum certificate verification depth--sniโ add an SNI-governed SSL context--sni-dirโ check forcert/key/client_cafiles in the directory you specify and create an sni/ssl context on demand--sni-dir-ciphersโ set the ssl ciphers for thesni-diroption--ssl-enable3โ enable SSLv3 (insecure ๐จ)--ssl-enable-sslv3โ enable SSLv3 (insecure ๐จ)--ssl-enable-tlsv1โ enable TLSv1 (insecure ๐จ)--ssl-optionโ set a raw ssl option (numeric value)--sni-regexpโ add an SNI-governed SSL context (the key is a regexp)--ssl-tmp-dirโ store ssl-related temp files in the directory you specify
โญ master checks, binaries & async
--check-intervalโ set the interval (in seconds) of master checks--forkbomb-delayโ sleep for the number of seconds you specify when a forkbomb is detected ๐ฃ--binary-pathโ force the binary path--privileged-binary-patchโ patch the uwsgi binary with a new command (before privileges drop)--unprivileged-binary-patchโ patch the uwsgi binary with a new command (after privileges drop)--privileged-binary-patch-argโ patch the uwsgi binary with a new command and arguments (before privileges drop)--unprivileged-binary-patch-argโ patch the uwsgi binary with a new command and arguments (after privileges drop)--asyncโ enable async mode with the number of cores you specify--max-fdโ set the maximum number of file descriptors (requires root privileges)
๐ logging (she's a talker and we love her)
--logtoโ set the logfile/udp address--logto2โ log to the specified file or udp address after privileges drop--log-formatโ set an advanced format for request logging--logformatโ set advanced format for request logging--logformat-strftimeโ apply strftime to logformat output--log-format-strftimeโ apply strftime to logformat output--logfile-chownโ chown logfiles--logfile-chmodโ chmod logfiles--log-syslogโ log to syslog--log-socketโ send logs to the specified socket--req-loggerโ set/append a request logger--logger-reqโ set/append a request logger--loggerโ set/append a logger--logger-listโ list enabled loggers--loggers-listโ list enabled loggers--threaded-loggerโ offload log writing to a thread ๐งต--log-encoderโ add an item in the log encoder chain--log-req-encoderโ add an item in the log req encoder chain--log-drainโ drain (a.k.a. do not show) log lines matching the regexp you give--log-filterโ show ONLY log lines matching the specified regexp--log-routeโ log to the named logger you specify if the regexp applied on the logline matches--log-req-routeโ log requests to the named logger you specify if the regexp applied on the logline matches
๐ last lil bits of this part
--use-abortโ callabort()on segfault/fpe, could be useful for generating a core dump--alarmโ create a new alarm, syntax:<alarm> <plugin:args>
okay that was a LOT but you ate that, bestie ๐ more coming, don't go anywhere ๐ซถ
okay bestie we're deep in the option swamp now and it is โจgivingโจ โ alarms, logging, routes, the whole little ecosystem. buckle up ๐
<h2>๐จ the alarm era ๐จ</h2>
--alarm-cheapโ don't spin up a whole dedicated thread squad for your curl-based alarms, just reuse the main alarm thread. lowkey efficient ๐--alarm-freqโ tunes the anti-loop alarm system. default is3seconds.--alarm-fdโ fires off the alarm you name whenever an fd gets read. by default it reads1byte, but set it to8if you're dealing witheventfd.--alarm-segfaultโ raise the specified alarm when the segmentation fault handler runs. ๐ญ (yes, that handler)--segfault-alarmโ same exact vibe as--alarm-segfault: raise the specified alarm when the segmentation fault handler is executed.--alarm-backlogโ raise the specified alarm when the socket backlog queue is full. she's at capacity bestie ๐ซฃ--backlog-alarmโ raise the specified alarm when the socket backlog queue is full.--lq-alarmโ raise the specified alarm when the socket backlog queue is full.--alarm-lqโ raise the specified alarm when the socket backlog queue is full.--alarm-listen-queueโ raise the specified alarm when the socket backlog queue is full.--listen-queue-alarmโ raise the specified alarm when the socket backlog queue is full. (six names for one behaviour? iconic, honestly ๐)--log-alarmโ raise the specified alarm when a log line matches the given regexp. syntax:<alarm>[,alarm...] <regexp>--alarm-logโ raise the specified alarm when a log line matches the given regexp. syntax:<alarm>[,alarm...] <regexp>--not-log-alarmโ the opposite energy: skip the specified alarm when a log line matches the given regexp. syntax:<alarm>[,alarm...] <regexp>--not-alarm-logโ skip the specified alarm when a log line matches the given regexp. syntax:<alarm>[,alarm...] <regexp>--alarm-listโ list every enabled alarm. window shopping โจ--alarms-listโ list enabled alarms.--alarm-msg-sizeโ caps how big an alarm message can get. default is8192.
<h2>๐ logging, my beloved ๐</h2>
--log-masterโ hand the whole logging job over to the master process.--log-master-bufsizeโ set the buffer size for the master logger. heads up: chonkier log messages than that will get truncated ๐--log-master-streamโ make the master logpipe aSOCK_STREAM.--log-master-req-streamโ make the master requests logpipe aSOCK_STREAM.--log-reopenโ reopen the log after a reload. fresh start energy ๐ธ--log-truncateโ truncate the log on startup.--log-maxsizeโ set the maximum logfile size.--log-backupnameโ set what the logfile gets named after rotation.--logdateโ prefix logs with a date, or with astrftimestring.--log-dateโ prefix logs with a date, or with astrftimestring.--log-prefixโ prefix logs with a string.--log-zeroโ log responses that have no body.--log-slowโ log any request slower than the number of milliseconds you give it. ๐ noticed--log-4xxโ log requests that came back4xx.--log-5xxโ log requests that came back5xx.--log-bigโ log requests bigger than the specified size.--log-sendfileโ logsendfilerequests.--log-ioerrorโ log requests that hit io errors.--log-microsโ report response time in microseconds instead of milliseconds. precision queen ๐ฌ--log-x-forwarded-forโ use the ip from theX-Forwarded-Forheader instead ofREMOTE_ADDR.
<h2>๐ privileges, cwd & shells ๐</h2>
--master-as-rootโ leave the master process running as root. (yes it does what it says, be careful bestie)--drop-after-initโ run the privileges drop after plugin initialization. superseded bydrop-after-apps.--drop-after-appsโ run the privileges drop after apps loading. superseded bymaster-as-root.--force-cwdโ force the initial working directory to the value you give it.--binshโ override/bin/sh(this is what exec hooks use; it always falls back to/bin/sh).--chdirโchdirto the specified directory before apps loading.--chdir2โchdirto the specified directory after apps loading.
<h2>๐ด lazy, cheap & cheaper modes ๐ด</h2>
--lazyโ set lazy mode (load apps in workers instead of master).--lazy-appsโ load apps in each worker instead of the master.--cheapโ set cheap mode (spawn workers only after the first request).--cheaperโ set cheaper mode (adaptive process spawning).--cheaper-initialโ set the initial number of processes to spawn in cheaper mode.--cheaper-algoโ choose which algorithm gets used for adaptive process spawning.--cheaper-stepโ how many additional processes to spawn at each overload.--cheaper-overloadโ increase workers after the specified overload.--cheaper-algo-listโ list the enabled cheapers algorithms.--cheaper-algos-listโ list the enabled cheapers algorithms.--cheaper-listโ list the enabled cheapers algorithms.--cheaper-rss-limit-softโ don't spawn new workers if the total resident memory usage of all workers is higher than this limit. ๐ซถ boundaries--cheaper-rss-limit-hardโ if total workers resident memory usage is higher, try to stop workers.--idleโ set idle mode (put uWSGI in cheap mode after inactivity).--die-on-idleโ shut uWSGI down when it's idle. dramatic exit, love that for her ๐
<h2>๐งต mounting & threads ๐งต</h2>
--mountโ load an application under a mountpoint.--worker-mountโ load an application under a mountpoint in the specified worker, or after workers spawn.--threadsโ run each worker in prethreaded mode with the specified number of threads.--thread-stacksizeโ set threads stacksize.--threads-stacksizeโ set threads stacksize.--thread-stack-sizeโ set threads stacksize.--threads-stack-sizeโ set threads stacksize. (four spellings, one destiny โจ)
<h2>๐ virtualhosting ๐ </h2>
--vhostโ enable virtualhosting mode (based on theSERVER_NAMEvariable).--vhost-hostโ enable virtualhosting mode (based on theHTTP_HOSTvariable).
<h2>๐ฃ๏ธ routing era, part one: the regular routes ๐ฃ๏ธ</h2>
--routeโ add a route.--route-hostโ add a route based on theHostheader.--route-uriโ add a route based onREQUEST_URI.--route-qsโ add a route based onQUERY_STRING.--route-remote-addrโ add a route based onREMOTE_ADDR.--route-user-agentโ add a route based onHTTP_USER_AGENT.--route-remote-userโ add a route based onREMOTE_USER.--route-refererโ add a route based onHTTP_REFERER.--route-labelโ add a routing label (for use withgoto).--route-ifโ add a route based on a condition.--route-if-notโ add a route based on a condition (the negate version). ๐--route-runโ always run the specified route action.
<h2>๐ final routes ๐</h2>
--final-routeโ add a final route.--final-route-statusโ add a final route for the specified status.--final-route-hostโ add a final route based on theHostheader.--final-route-uriโ add a final route based onREQUEST_URI.--final-route-qsโ add a final route based onQUERY_STRING.--final-route-remote-addrโ add a final route based onREMOTE_ADDR.--final-route-user-agentโ add a final route based onHTTP_USER_AGENT.--final-route-remote-userโ add a final route based onREMOTE_USER.--final-route-refererโ add a final route based onHTTP_REFERER.--final-route-labelโ add a final routing label (for use withgoto).--final-route-ifโ add a final route based on a condition.--final-route-if-notโ add a final route based on a condition (negate version).--final-route-runโ always run the specified final route action.
<h2>๐ฅ error routes ๐ฅ</h2>
--error-routeโ add an error route.--error-route-statusโ add an error route for the specified status.--error-route-hostโ add an error route based on theHostheader.--error-route-uriโ add an error route based onREQUEST_URI.--error-route-qsโ add an error route based onQUERY_STRING.--error-route-remote-addrโ add an error route based onREMOTE_ADDR.--error-route-user-agentโ add an error route based onHTTP_USER_AGENT.--error-route-remote-userโ add an error route based onREMOTE_USER.--error-route-refererโ add an error route based onHTTP_REFERER.--error-route-labelโ add an error routing label (for use withgoto).--error-route-ifโ add an error route based on a condition.--error-route-if-notโ add an error route based on a condition (negate version).--error-route-runโ always run the specified error route action.
<h2>๐ฌ response routes ๐ฌ</h2>
--response-routeโ add a response route.--response-route-statusโ add a response route for the specified status.--response-route-hostโ add a response route based on theHostheader.--response-route-uriโ add a response route based onREQUEST_URI.--response-route-qsโ add a response route based onQUERY_STRING.--response-route-remote-addrโ add a response route based onREMOTE_ADDR.--response-route-user-agentโ add a response route based onHTTP_USER_AGENT.--response-route-remote-userโ add a response route based onREMOTE_USER.--response-route-refererโ add a response route based onHTTP_REFERER.--response-route-labelโ add a response routing label (for use withgoto).--response-route-ifโ add a response route based on a condition.--response-route-if-notโ add a response route based on a condition (negate version).--response-route-runโ always run the specified response route action.
<h2>๐งญ routers & error pages ๐งญ</h2>
--router-listโ list enabled routers.--routers-listโ list enabled routers.--error-page-403โ add an error page (html) for the managed403response.--error-page-404โ add an error page (html) for the managed404response.--error-page-500โ add an error page (html) for the managed500response.
<h2>๐ฆ websockets & chunked input ๐ฆ</h2>
--websockets-ping-freqโ set the frequency (in seconds) of the websockets automatic ping packets.--websocket-ping-freqโ set the frequency (in seconds) of the websockets automatic ping packets.--websockets-pong-toleranceโ set the tolerance (in seconds) of the websockets ping/pong subsystem.--websocket-pong-toleranceโ set the tolerance (in seconds) of the websockets ping/pong subsystem.--websockets-max-sizeโ set the max allowed size of websocket messages (in Kbytes, default1024).--websocket-max-sizeโ set the max allowed size of websocket messages (in Kbytes, default1024).--chunked-input-limitโ set the max size of a chunked input part (default1MB, in bytes).--chunked-input-timeoutโ set the default timeout for chunked input.
<h2>โฐ clocks โฐ</h2>
--clockโ set a clock source.--clock-listโ list enabled clocks.
okay bestie, deep breath, we're in the final stretch of the option list and it is long, but you've got this and I've got you ๐ buckle up:
--clocks-listโ lists all the enabled clocks โฐ like a little roll call for time itself--add-headerโ auto-slaps HTTP headers onto the response, no manual labor required ๐--rem-headerโ auto-yeets the HTTP header you specify right out of the response--del-headerโ same energy, auto-removes the HTTP header you name from the response ๐ซถ--collect-headerโ stashes the response header you name into a request var (syntax:header var)--response-header-collectโ literally the same thing: stash the named response header in a request var (syntax:header var)--pull-headerโ stashes the named response header in a request var and rips it out of the response (syntax:header var) ๐--check-staticโ looks for static files in the directory you point at--check-static-docrootโ looks for static files in the requestedDOCUMENT_ROOT--static-checkโ yep, looks for static files in the directory you gave it--static-mapโ maps a mountpoint to a static directory (or a single file)--static-map2โ likestatic-mapbut it fully appends the requested resource onto the docroot--static-skip-extโ skips that specific extension when it's doing static file checks--static-indexโ if someone requests a directory, it goes hunting for the file you specified--static-safeโ skips the security checks when the file lives under the path you named--static-cache-pathsโ drops resolved paths into the uWSGI cache for however many seconds you say--static-cache-paths-nameโ uses the cache you picked for static paths--mimefileโ sets the mime types file path (default/etc/mime.types)--mime-fileโ sets the mime types file path (default/etc/mime.types) โ yes bestie it's the twin โจ--static-expires-typeโ sets theExpiresheader based on content type--static-expires-type-mtimeโ sets theExpiresheader based on content type and file mtime--static-expiresโ sets theExpiresheader based on filename regexp--static-expires-mtimeโ sets theExpiresheader based on filename regexp and file mtime--static-expires-uriโ sets theExpiresheader based onREQUEST_URIregexp--static-expires-uri-mtimeโ sets theExpiresheader based onREQUEST_URIregexp and file mtime--static-expires-path-infoโ sets theExpiresheader based onPATH_INFOregexp--static-expires-path-info-mtimeโ sets theExpiresheader based onPATH_INFOregexp and file mtime--static-gzipโ if your regexp matches the static file translation, it'll go look for a gzip version ๐๏ธ--static-gzip-allโ checks for a gzip version of every requested static file, no exceptions--static-gzip-dirโ checks for a gzip version of all requested static files in the dir/prefix you gave--static-gzip-prefixโ also checks for a gzip version of all requested static files in the specified dir/prefix--static-gzip-extโ checks for a gzip version of all requested static files with the ext/suffix you set--static-gzip-suffixโ again: checks for a gzip version of all requested static files with the specified ext/suffix--honour-rangeโ turns on support for the HTTPRangeheader ๐--offload-threadsโ sets how many offload threads to spawn (per-worker, default0)--offload-threadโ sets how many offload threads to spawn (per-worker, default0) ๐งต--file-serve-modeโ sets the static file serving mode--fileserve-modeโ sets the static file serving mode (same fit, different spelling)--disable-sendfileโ killssendfile()and makes it rely on the extremely boringread()/write()๐--check-cacheโ checks for response data in the cache you name (leave it empty for the default cache)--close-on-execโ sets close-on-exec on connection sockets (could be required for spawning processes in requests)--close-on-exec2โ sets close-on-exec on server sockets (could be required for spawning processes in requests)
static files? handled. headers? handled. we're so back ๐ฆ
--modeโ sets a uWSGI custom mode--envโ sets an environment variable--envdirโ loads a daemontools compatible envdir--early-envdirโ loads a daemontools compatible envdir ASAP โก--unenvโ unsets an environment variable (the breakup option)--vacuumโ tries to remove all of the generated file/sockets, Marie Kondo style ๐งน--file-writeโ writes the content you specify to the file you specify (syntax:file=value) before privileges drop--cgroupโ puts the processes in the cgroup you named--cgroup-optโ sets a value in the cgroup option you named--cgroup-dir-modeโ sets permission for the cgroup directory (default is700)--namespaceโ runs in a new namespace under the rootfs you specify--namespace-keep-mountโ keeps the mountpoint you named inside your namespace--nsโ runs in a new namespace under the specified rootfs (short king ๐)--namespace-netโ adds a network namespace--ns-netโ adds a network namespace--enable-proxy-protocolโ enablesPROXY1protocol support (only for http parsers)--reuse-portโ enables theREUSE_PORTflag on a socket (BSD only ๐)--tcp-fast-openโ enables theTCP_FASTOPENflag on TCP sockets with the qlen value you give--tcp-fastopenโ enables theTCP_FASTOPENflag on TCP sockets with the specified qlen value--tcp-fast-open-clientโ usessendto(..., MSG_FASTOPEN, ...)instead ofconnect()if supported--tcp-fastopen-clientโ usessendto(..., MSG_FASTOPEN, ...)instead ofconnect()if supported--zergโ attaches to a zerg server ๐--zerg-fallbackโ falls back to normal sockets if the zerg server isn't available (no shame in a plan B)--zerg-serverโ enables the zerg server on the UNIX socket you specify--cronโ adds a cron task--cron2โ adds a cron task (key=valsyntax)--unique-cronโ adds a unique cron task โจ--cron-harakiriโ sets the maximum time (in seconds) we wait for a cron command to complete--legion-cronโ adds a cron task that only runs when the instance is a lord of the legion you named--cron-legionโ adds a cron task runnable only when the instance is a lord of the specified legion--unique-legion-cronโ adds a unique cron task runnable only when the instance is a lord of the specified legion--unique-cron-legionโ adds a unique cron task runnable only when the instance is a lord of the specified legion--loopโ selects the uWSGI loop engine ๐--loop-listโ lists the enabled loop engines--loops-listโ lists the enabled loop engines (plural girlies, same answer)
daemons, plugins, and the grand finale, let's gooo ๐
--worker-execโ runs the command you specify as a worker--worker-exec2โ runs the specified command as a worker (after thepost_forkhook)--attach-daemonโ attaches a command/daemon to the master process โ ๏ธ the command has to not go in background--attach-control-daemonโ attaches a command/daemon to the master process (again, the command has to not go in background), and when the daemon dies, the master dies too ๐ญ ride or die fr--smart-attach-daemonโ attaches a command/daemon to the master process managed by a pidfile (this time the command has to daemonize)--smart-attach-daemon2โ attaches a command/daemon to the master process managed by a pidfile (and here the command has to NOT daemonize โ opposite day)--legion-attach-daemonโ same as--attach-daemonbut the daemon runs only on a legion lord node--legion-smart-attach-daemonโ same as--smart-attach-daemonbut it runs only on a legion lord node--legion-smart-attach-daemon2โ same as--smart-attach-daemon2but it runs only on a legion lord node--daemons-honour-stdinโ does not change the stdin of external daemons to/dev/null(respecting their little stdin, cute)--attach-daemon2โ theattach-daemonkeyval variant (supports smart modes too)--pluginsโ loads uWSGI plugins ๐งฉ--pluginโ loads uWSGI plugins--need-pluginsโ loads uWSGI plugins (and exits on error, no half measures)--need-pluginโ loads uWSGI plugins (exit on error)--plugins-dirโ adds a directory to the uWSGI plugin search path--plugin-dirโ adds a directory to the uWSGI plugin search path--plugins-listโ lists the enabled plugins--plugin-listโ lists the enabled plugins--autoloadโ tries to automatically load plugins when it bumps into unknown options--dlopenโ blindly loads a shared library ๐ (it does not ask questions)--allowed-modifiersโ a comma separated list of allowed modifiers--remap-modifierโ remaps a request modifier from one id to another--dump-optionsโ dumps the full list of every available option (yes, all of them, all 40-million ๐ซ )--show-configโ shows the current config reformatted as ini--binary-append-dataโ returns the content of a resource to stdout for appending to a uwsgi binary (fordata://usage)--printโ a simple print--iprintโ a simple print, but the immediate version โก--exitโ forcesexit()of the instance, dramatic exit, door slam, periodt--cflagsโ reports uWSGICFLAGS(useful for building external plugins)--dot-hโ dumps theuwsgi.hused for building the core (useful for building external plugins)--config-pyโ dumps theuwsgiconfig.pyused for building the core (useful for building external plugins)--build-pluginโ builds a uWSGI plugin for the current binary ๐จ--versionโ prints the uWSGI version--response-headers-limitโ sets the response header maximum size (default:64k)
and that's the whole list bestie, we ATE ๐ every single flag survived the vibe check, nothing dropped, nothing merged, no cap.
this page isuwsgi_emperor_pg, version2.0.31-debian, dated July 2026, living in sectionUWSGI_EMPEROR_PG(1)โ and with that, the manual is officially over. go forth and serve some static files, you absolute icon ๐โจ๐
๐ฆ where this page comes from
- ubuntu stonking: uwsgi-plugin-emperor-pg 2.0.31-6build1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms