Reference

Reference: site file

aliases

Syntaxaliases: [<string>, ...]
Defaultnone
Contextsite file
Reloadapplies on reload

Further domains served by the same site.

cache

Syntaxcache: {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Response cache for the site; absent: no caching.

cache.bypass_cookies

Syntaxbypass_cookies: [<string>, ...]
Default[]
Contextcache
Reloadapplies on reload

Cookie-name prefixes that mark a personalised request (added to the profile’s).

cache.bypass_paths

Syntaxbypass_paths: [<string>, ...]
Default[]
Contextcache
Reloadapplies on reload

Path prefixes that are never cached (added to the profile’s).

cache.bypass_query

Syntaxbypass_query: [<string>, ...]
Default[]
Contextcache
Reloadapplies on reload

Query parameters that disable caching (added to the profile’s).

cache.default_ttl

Syntaxdefault_ttl: <duration> (e.g. 30s)
Defaultnone
Contextcache
Reloadapplies on reload

Freshness for 200 responses that carry no caching headers at all. Default: none (only explicitly cacheable responses are stored).

cache.enabled

Syntaxenabled: true | false
Defaulttrue
Contextcache
Reloadapplies on reload

Cache this application’s responses.

cache.stale_while_revalidate

Syntaxstale_while_revalidate: <duration> (e.g. 30s)
Defaultnone
Contextcache
Reloadapplies on reload

Serve stale entries this long while refreshing in the background.

domain

Syntaxdomain: <string>
Defaultrequired
Contextsite file
Reloadapplies on reload

The site’s main domain.

htaccess

Syntaxhtaccess: true | false
Defaultnone
Contextsite file
Reloadapplies on reload

Read Apache .htaccess files below root (ADR-0031).

https_redirect

Syntaxhttps_redirect: true | false
Defaultnone
Contextsite file
Reloadapplies on reload

Redirect plain HTTP to HTTPS (the www. redirect follows it).

name

Syntaxname: <string>
Defaultnone
Contextsite file
Reloadapplies on reload

Application name; default derived from domain.

node

Syntaxnode: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Node.js: the command as a string or list, or the Node.js settings.

node.command

Syntaxcommand: [<string>, ...]
Default[]
Contextnode
Reloadapplies on reload

Command started by scalws (no shell), e.g. [node, server.js]; the application listens on PORT.

node.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextnode
Reloadapplies on reload

Environment variables for the process.

node.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextnode
Reloadapplies on reload

Optional readiness path; any non-5xx answer counts as ready.

node.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextnode
Reloadapplies on reload

unix: a socket under runtime_dir passed as PORT; tcp: a free loopback port.

node.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextnode
Reloadapplies on reload

Time to wait for the response headers of the application.

node.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextnode
Reloadapplies on reload

Time the process gets to become ready.

node.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextnode
Reloadapplies on reload

Time the process gets to exit after SIGTERM before it is killed.

node.upstream

Syntaxupstream: <string>
Defaultnone
Contextnode
Reloadapplies on reload

Proxy to a Node.js process managed elsewhere instead of starting one.

node.workers

Syntaxworkers: {...}
Defaultnone
Contextnode
Reloadapplies on reload

Number of processes (min); requests are balanced across ready ones.

node.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextnode.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

node.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextnode.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

node.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextnode.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

node.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextnode.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

php

Syntaxphp: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

PHP: true (a managed PHP-FPM pool), the address of an existing pool (unix:/run/php/php8.3-fpm.sock) or the PHP settings.

php.fastcgi

Syntaxfastcgi: <string>
Defaultnone
Contextphp
Reloadapplies on reload

External pool: unix:/path.sock or tcp:host:port. Mutually exclusive with fpm.

php.fpm

Syntaxfpm: {...}
Defaultnone
Contextphp
Reloadapplies on reload

Managed PHP-FPM pool settings (workers, ini values); not used with fastcgi.

php.fpm.binary

Syntaxbinary: <string>
Defaultnone
Contextphp.fpm
Reloadapplies on reload

PHP-FPM binary; default: php-fpm on PATH, else the newest versioned one (php-fpm8.4, Alpine’s php-fpm84).

php.fpm.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextphp.fpm
Reloadapplies on reload

Environment passed to PHP (env[...]).

php.fpm.ini

Syntaxini: {<key>: <string>, ...}
Defaultempty
Contextphp.fpm
Reloadapplies on reload

php_admin_value[...] settings, e.g. memory_limit: 256M.

php.fpm.max_requests

Syntaxmax_requests: <integer>
Default500
Contextphp.fpm
Reloadapplies on reload

pm.max_requests; 0 disables recycling.

php.fpm.workers

Syntaxworkers: {...}
Defaultnone
Contextphp.fpm
Reloadapplies on reload

min = pm.start_servers/pm.min_spare_servers, max = pm.max_children.

php.fpm.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextphp.fpm.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

php.fpm.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextphp.fpm.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

php.fpm.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextphp.fpm.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

php.fpm.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextphp.fpm.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

php.front_controller

Syntaxfront_controller: <string>
Defaultnone
Contextphp
Reloadapplies on reload

Script that handles requests for paths that do not exist, e.g. /index.php.

php.index

Syntaxindex: [<string>, ...]
Default["index.php","index.html"]
Contextphp
Reloadapplies on reload

Index files for directory requests, tried in order.

php.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextphp
Reloadapplies on reload

Time to wait for PHP-FPM’s response headers.

php.root

Syntaxroot: <string>
Defaultnone
Contextphp
Reloadapplies on reload

Document root; defaults to the application root.

php.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextphp
Reloadapplies on reload

Time the managed PHP-FPM pool gets to become ready.

php.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextphp
Reloadapplies on reload

Time the managed pool gets to exit before it is killed.

profile

Syntaxprofile: <string>
Defaultnone
Contextsite file
Reloadapplies on reload

Application profile, e.g. wordpress (deny rules, cache bypass, defaults).

proxy

Syntaxproxy: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Reverse proxy: the upstream URL or the proxy settings.

proxy.backends

Syntaxbackends: [{...}, ...]
Defaultnone
Contextproxy
Reloadapplies on reload

Weighted split per request across pools (alternative to upstream).

proxy.backends[].pool

Syntaxpool: <string>
Defaultnone
Contextproxy.backends[]
Reloadapplies on reload

Name of a pool in upstreams; alternative to status.

proxy.backends[].status

Syntaxstatus: <integer>
Defaultnone
Contextproxy.backends[]
Reloadapplies on reload

Answers this share of the requests with this status (500-599) instead of sending them to a pool.

proxy.backends[].weight

Syntaxweight: <integer>
Default1
Contextproxy.backends[]
Reloadapplies on reload

Share of requests (0..=1000); 0 sends none.

proxy.client

Syntaxclient: hyper | experimental
Defaultnone
Contextproxy
Reloadapplies on reload

HTTP/1 client used towards this upstream; unset: server.upstream_client.

proxy.connect_timeout

Syntaxconnect_timeout: <duration> (e.g. 30s)
Default5s
Contextproxy
Reloadapplies on reload

Time to establish a connection to the upstream.

proxy.preserve_host

Syntaxpreserve_host: true | false
Defaulttrue
Contextproxy
Reloadapplies on reload

Forward the client’s Host header (default) instead of the upstream authority.

proxy.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextproxy
Reloadapplies on reload

Time allowed for the upstream to return response headers.

proxy.tls_ca_file

Syntaxtls_ca_file: <string>
Defaultnone
Contextproxy
Reloadapplies on reload

Extra CA bundle (PEM) trusted for https:// upstreams, in addition to the system roots.

proxy.upstream

Syntaxupstream: <string> | {...}
Defaultnone
Contextproxy
Reloadapplies on reload

http://host:port, https://host:port or unix:/absolute/path.sock (one address, no retries), or {pool: name}: a pool from upstreams.

proxy.upstream.pool

Syntaxpool: <string>
Defaultrequired
Contextproxy.upstream
Reloadapplies on reload

Name of a pool in upstreams.

proxy.websocket

Syntaxwebsocket: true | false
Defaulttrue
Contextproxy
Reloadapplies on reload

Allow WebSocket upgrades to be tunnelled to this upstream.

python

Syntaxpython: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Python: module:app (ASGI through uvicorn) or the Python settings.

python.app

Syntaxapp: <string>
Defaultnone
Contextpython
Reloadapplies on reload

module:callable, e.g. app:app or mysite.wsgi:application.

python.command

Syntaxcommand: [<string>, ...]
Default[]
Contextpython
Reloadapplies on reload

Explicit argv. Bind arguments are appended for uvicorn/hypercorn/gunicorn unless the argv already contains {socket} or {port}.

python.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextpython
Reloadapplies on reload

Environment variables for the processes.

python.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextpython
Reloadapplies on reload

Path requested to decide that a worker is ready and healthy.

python.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextpython
Reloadapplies on reload

unix: a socket under runtime_dir; tcp: a free loopback port.

python.mode

Syntaxmode: asgi | wsgi
Defaultrequired
Contextpython
Reloadapplies on reload

asgi (uvicorn) or wsgi (gunicorn).

python.process_pool

Syntaxprocess_pool: true | false
Defaultfalse
Contextpython
Reloadapplies on reload

scalws runs workers.min..max single-worker server processes itself instead of one server with --workers, so the pool can be scaled and restarted live (ADR-0014). Trades the server’s copy-on-write sharing for scaling.

python.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextpython
Reloadapplies on reload

Time to wait for the response headers of the application.

python.server

Syntaxserver: uvicorn | hypercorn | gunicorn
Defaultnone
Contextpython
Reloadapplies on reload

Default: uvicorn for ASGI, gunicorn for WSGI.

python.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextpython
Reloadapplies on reload

Time the processes get to become ready.

python.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextpython
Reloadapplies on reload

Time the processes get to exit after SIGTERM before they are killed.

python.upstream

Syntaxupstream: <string>
Defaultnone
Contextpython
Reloadapplies on reload

Proxy to a Python server managed elsewhere instead of starting one.

python.virtualenv

Syntaxvirtualenv: <string>
Defaultnone
Contextpython
Reloadapplies on reload

Virtual environment whose server binary and packages are used.

python.workers

Syntaxworkers: {...}
Defaultnone
Contextpython
Reloadapplies on reload

Worker processes of the application server (min).

python.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextpython.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

python.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextpython.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

python.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextpython.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

python.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextpython.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

redirect

Syntaxredirect: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Redirect: the target origin or the redirect settings.

redirect.host

Syntaxhost: <string>
Defaultnone
Contextredirect
Reloadapplies on reload

Replaces the request’s host; unset: taken from the request.

redirect.keep_path

Syntaxkeep_path: true | false
Defaulttrue
Contextredirect
Reloadapplies on reload

Append the request’s path and query to to.

redirect.path

Syntaxpath: <string>
Defaultnone
Contextredirect
Reloadapplies on reload

Replaces the request’s path; unset: taken from the request.

redirect.port

Syntaxport: <integer>
Defaultnone
Contextredirect
Reloadapplies on reload

Replaces the request’s port; unset: the well-known port of a configured scheme, else taken from the request.

redirect.prefix

Syntaxprefix: <string>
Defaultnone
Contextredirect
Reloadapplies on reload

Replaces the matched prefix of the request’s path; unset: taken from the request.

redirect.scheme

Syntaxscheme: http | https
Defaultnone
Contextredirect
Reloadapplies on reload

Replaces the request’s scheme; unset: taken from the request.

redirect.status

Syntaxstatus: <integer>
Default301
Contextredirect
Reloadapplies on reload

301, 302, 303, 307 or 308.

redirect.to

Syntaxto: <string>
Defaultnone
Contextredirect
Reloadapplies on reload

Target origin, e.g. https://example.com: scheme and host (and port), no path when keep_path is on. Alternative to the fields scheme, host, port, path and prefix.

resources

Syntaxresources: {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Tenant resource limits; set them in one site file per tenant.

resources.burst

Syntaxburst: <integer>
Defaultnone
Contextresources
Reloadapplies on reload

Token-bucket burst for requests_per_second (default: equal to the rate).

resources.cpu

Syntaxcpu: <cpu quota> (e.g. "400%")
Defaultnone
Contextresources
Reloadapplies on reload

cpu.max, e.g. "400%" = four CPUs.

resources.io_bandwidth

Syntaxio_bandwidth: <size> (e.g. 16KiB)
Defaultnone
Contextresources
Reloadapplies on reload

io.max: read and write bytes per second each, on every disk holding the tenant’s application roots, e.g. "20MiB".

resources.io_weight

Syntaxio_weight: <integer>
Defaultnone
Contextresources
Reloadapplies on reload

io.weight (1-10000, default 100), best effort: needs a weight-capable I/O scheduler.

resources.max_concurrent_requests

Syntaxmax_concurrent_requests: <integer>
Defaultnone
Contextresources
Reloadapplies on reload

Requests of this tenant processed concurrently; excess gets 503.

resources.memory

Syntaxmemory: <size> (e.g. 16KiB)
Defaultnone
Contextresources
Reloadapplies on reload

memory.max.

resources.pids

Syntaxpids: <integer>
Defaultnone
Contextresources
Reloadapplies on reload

pids.max.

resources.requests_per_second

Syntaxrequests_per_second: <integer>
Defaultnone
Contextresources
Reloadapplies on reload

Sustained request rate; excess gets 429.

resources.swap

Syntaxswap: <size> (e.g. 16KiB)
Defaultnone
Contextresources
Reloadapplies on reload

memory.swap.max when memory is set; default 0 (no swap).

root

Syntaxroot: <string>
Defaultnone
Contextsite file
Reloadapplies on reload

Document root: static files, PHP scripts or the application’s directory.

Syntaxroot_symlinks: follow | refuse
Defaultnone
Contextsite file
Reloadapplies on reload

Symbolic links in the path of root: follow (default) or refuse (the root must be canonical and is opened without following links; for hosting panels).

routes

Syntaxroutes: [{...}, ...]
Defaultnone
Contextsite file
Reloadapplies on reload

Path-prefix routes with their own runtime.

routes[].allow

Syntaxallow: [<string>, ...]
Defaultnone
Contextroutes[]
Reloadapplies on reload

Client addresses and CIDR blocks allowed; if set, only these clients (403 else).

routes[].basic_auth

Syntaxbasic_auth: {...}
Defaultnone
Contextroutes[]
Reloadapplies on reload

HTTP basic authentication against an htpasswd file.

routes[].basic_auth.realm

Syntaxrealm: <string>
DefaultRestricted
Contextroutes[].basic_auth
Reloadapplies on reload

Realm shown by the browser (default Restricted).

routes[].basic_auth.users_file

Syntaxusers_file: <string>
Defaultrequired
Contextroutes[].basic_auth
Reloadapplies on reload

Absolute path of an htpasswd file (bcrypt, SHA-256/512 crypt or Apache MD5 entries).

routes[].cors

Syntaxcors: {...}
Defaultnone
Contextroutes[]
Reloadapplies on reload

Cross-origin resource sharing; preflight requests are answered by ScalWS.

routes[].cors.allow_credentials

Syntaxallow_credentials: true | false
Defaultfalse
Contextroutes[].cors
Reloadapplies on reload

Allow credentials (cookies, authorization); not with allow_origins: ["*"].

routes[].cors.allow_headers

Syntaxallow_headers: [<string>, ...]
Default["DNT","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type","Range","Authorization"]
Contextroutes[].cors
Reloadapplies on reload

Request headers allowed in preflight answers (ingress-nginx defaults).

routes[].cors.allow_methods

Syntaxallow_methods: [<string>, ...]
Default["GET","PUT","POST","DELETE","PATCH","OPTIONS"]
Contextroutes[].cors
Reloadapplies on reload

Methods allowed in preflight answers (default: GET, PUT, POST, DELETE, PATCH, OPTIONS).

routes[].cors.allow_origins

Syntaxallow_origins: [<string>, ...]
Defaultrequired
Contextroutes[].cors
Reloadapplies on reload

Allowed origins, e.g. https://app.example.com, https://*.example.com, or ["*"].

routes[].cors.expose_headers

Syntaxexpose_headers: [<string>, ...]
Defaultnone
Contextroutes[].cors
Reloadapplies on reload

Response headers exposed to the page.

routes[].cors.max_age

Syntaxmax_age: <duration> (e.g. 30s)
Default1728000s
Contextroutes[].cors
Reloadapplies on reload

How long a preflight answer may be cached, at most 365 days (default 20 days).

routes[].deny

Syntaxdeny: [<string>, ...]
Defaultnone
Contextroutes[]
Reloadapplies on reload

Client addresses and CIDR blocks refused with 403; checked after allow.

routes[].headers

Syntaxheaders: [{...}, ...]
Defaultnone
Contextroutes[]
Reloadapplies on reload

Request headers that must match (all of them).

routes[].headers[].name

Syntaxname: <string>
Defaultrequired
Contextroutes[].headers[]
Reloadapplies on reload

Header name (case-insensitive) or query parameter name.

routes[].headers[].regex

Syntaxregex: <string>
Defaultnone
Contextroutes[].headers[]
Reloadapplies on reload

Regular expression the value must match (searched anywhere unless anchored).

routes[].headers[].value

Syntaxvalue: <string>
Defaultnone
Contextroutes[].headers[]
Reloadapplies on reload

Exact, case-sensitive value.

routes[].https_redirect

Syntaxhttps_redirect: true | false
Defaultnone
Contextroutes[]
Reloadapplies on reload

Answer plain-HTTP requests that select this route with a 301 to HTTPS; unset: the application’s https_redirect.

routes[].max_body

Syntaxmax_body: <size> (e.g. 16KiB)
Defaultnone
Contextroutes[]
Reloadapplies on reload

Largest request body; overrides limits.max_request_body_bytes; 413 above.

routes[].methods

Syntaxmethods: [<string>, ...]
Defaultnone
Contextroutes[]
Reloadapplies on reload

Request methods this route matches, e.g. [GET, POST]; empty: any.

routes[].path

Syntaxpath: <string>
Defaultrequired
Contextroutes[]
Reloadapplies on reload

Path of the route; how it is compared depends on path_type.

routes[].path_type

Syntaxpath_type: prefix | exact | regex
Defaultnone
Contextroutes[]
Reloadapplies on reload

prefix (default, whole segments, longest first), exact or regex (anchored at the start, in configuration order).

routes[].query

Syntaxquery: [{...}, ...]
Defaultnone
Contextroutes[]
Reloadapplies on reload

Query parameters that must match (all of them, decoded, first occurrence).

routes[].query[].name

Syntaxname: <string>
Defaultrequired
Contextroutes[].query[]
Reloadapplies on reload

Header name (case-insensitive) or query parameter name.

routes[].query[].regex

Syntaxregex: <string>
Defaultnone
Contextroutes[].query[]
Reloadapplies on reload

Regular expression the value must match (searched anywhere unless anchored).

routes[].query[].value

Syntaxvalue: <string>
Defaultnone
Contextroutes[].query[]
Reloadapplies on reload

Exact, case-sensitive value.

routes[].request_headers

Syntaxrequest_headers: {...}
Defaultnone
Contextroutes[]
Reloadapplies on reload

Changes to the request headers (after the built-in proxy headers).

routes[].request_headers.add

Syntaxadd: {<key>: <string>, ...}
Defaultnone
Contextroutes[].request_headers
Reloadapplies on reload

Headers added next to any present.

routes[].request_headers.remove

Syntaxremove: [<string>, ...]
Defaultnone
Contextroutes[].request_headers
Reloadapplies on reload

Headers removed.

routes[].request_headers.set

Syntaxset: {<key>: <string>, ...}
Defaultnone
Contextroutes[].request_headers
Reloadapplies on reload

Headers set to this value, replacing any present.

routes[].request_timeout

Syntaxrequest_timeout: <duration> (e.g. 30s)
Defaultnone
Contextroutes[]
Reloadapplies on reload

Time from the route match until the response head; 504 when exceeded.

routes[].response_headers

Syntaxresponse_headers: {...}
Defaultnone
Contextroutes[]
Reloadapplies on reload

Changes to every response of the route, including errors generated by ScalWS.

routes[].response_headers.add

Syntaxadd: {<key>: <string>, ...}
Defaultnone
Contextroutes[].response_headers
Reloadapplies on reload

Headers added next to any present.

routes[].response_headers.remove

Syntaxremove: [<string>, ...]
Defaultnone
Contextroutes[].response_headers
Reloadapplies on reload

Headers removed.

routes[].response_headers.set

Syntaxset: {<key>: <string>, ...}
Defaultnone
Contextroutes[].response_headers
Reloadapplies on reload

Headers set to this value, replacing any present.

routes[].rewrite

Syntaxrewrite: {...}
Defaultnone
Contextroutes[]
Reloadapplies on reload

Path and Host rewrite before the runtime.

routes[].rewrite.host

Syntaxhost: <string>
Defaultnone
Contextroutes[].rewrite
Reloadapplies on reload

Host sent upstream (implies preserve_host: false), host or host:port.

routes[].rewrite.path

Syntaxpath: <string>
Defaultnone
Contextroutes[].rewrite
Reloadapplies on reload

Full path; $1..$9 from a regex route, $0 the match, $$ a literal $; ?... in it sets the query (else the query is kept).

routes[].rewrite.prefix

Syntaxprefix: <string>
Defaultnone
Contextroutes[].rewrite
Reloadapplies on reload

Replaces the matched prefix (prefix routes only).

routes[].runtime

Syntaxruntime: {...}
Defaultrequired
Contextroutes[]
Reloadapplies on reload

Runtime that handles requests under the path.

routes[].runtime<static>.index

Syntaxindex: [<string>, ...]
Default["index.html"]
Contextroutes[].runtime (type: static)
Reloadapplies on reload

File names served for a directory request, tried in order.

routes[].runtime<static>.precompressed

Syntaxprecompressed: true | false
Defaultfalse
Contextroutes[].runtime (type: static)
Reloadapplies on reload

Serve <file>.br / <file>.gz siblings to clients that accept them.

routes[].runtime<static>.root

Syntaxroot: <string>
Defaultnone
Contextroutes[].runtime (type: static)
Reloadapplies on reload

Document root. Defaults to the application’s root.

routes[].runtime<proxy>.backends

Syntaxbackends: [{...}, ...]
Defaultnone
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Weighted split per request across pools (alternative to upstream).

routes[].runtime<proxy>.backends[].pool

Syntaxpool: <string>
Defaultnone
Contextroutes[].runtime<proxy>.backends[]
Reloadapplies on reload

Name of a pool in upstreams; alternative to status.

routes[].runtime<proxy>.backends[].status

Syntaxstatus: <integer>
Defaultnone
Contextroutes[].runtime<proxy>.backends[]
Reloadapplies on reload

Answers this share of the requests with this status (500-599) instead of sending them to a pool.

routes[].runtime<proxy>.backends[].weight

Syntaxweight: <integer>
Default1
Contextroutes[].runtime<proxy>.backends[]
Reloadapplies on reload

Share of requests (0..=1000); 0 sends none.

routes[].runtime<proxy>.client

Syntaxclient: hyper | experimental
Defaultnone
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

HTTP/1 client used towards this upstream; unset: server.upstream_client.

routes[].runtime<proxy>.connect_timeout

Syntaxconnect_timeout: <duration> (e.g. 30s)
Default5s
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Time to establish a connection to the upstream.

routes[].runtime<proxy>.preserve_host

Syntaxpreserve_host: true | false
Defaulttrue
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Forward the client’s Host header (default) instead of the upstream authority.

routes[].runtime<proxy>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Time allowed for the upstream to return response headers.

routes[].runtime<proxy>.tls_ca_file

Syntaxtls_ca_file: <string>
Defaultnone
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Extra CA bundle (PEM) trusted for https:// upstreams, in addition to the system roots.

routes[].runtime<proxy>.upstream

Syntaxupstream: <string> | {...}
Defaultnone
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

http://host:port, https://host:port or unix:/absolute/path.sock (one address, no retries), or {pool: name}: a pool from upstreams.

routes[].runtime<proxy>.upstream.pool

Syntaxpool: <string>
Defaultrequired
Contextroutes[].runtime<proxy>.upstream
Reloadapplies on reload

Name of a pool in upstreams.

routes[].runtime<proxy>.websocket

Syntaxwebsocket: true | false
Defaulttrue
Contextroutes[].runtime (type: proxy)
Reloadapplies on reload

Allow WebSocket upgrades to be tunnelled to this upstream.

routes[].runtime<respond>.body

Syntaxbody: <string>
Default“
Contextroutes[].runtime (type: respond)
Reloadapplies on reload

Response body (at most 64 KiB).

routes[].runtime<respond>.content_type

Syntaxcontent_type: <string>
Defaultnone
Contextroutes[].runtime (type: respond)
Reloadapplies on reload

Content-Type of the response; default text/plain; charset=utf-8.

routes[].runtime<respond>.status

Syntaxstatus: <integer>
Default200
Contextroutes[].runtime (type: respond)
Reloadapplies on reload

HTTP status of the fixed response (200-599).

routes[].runtime<redirect>.host

Syntaxhost: <string>
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Replaces the request’s host; unset: taken from the request.

routes[].runtime<redirect>.keep_path

Syntaxkeep_path: true | false
Defaulttrue
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Append the request’s path and query to to.

routes[].runtime<redirect>.path

Syntaxpath: <string>
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Replaces the request’s path; unset: taken from the request.

routes[].runtime<redirect>.port

Syntaxport: <integer>
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Replaces the request’s port; unset: the well-known port of a configured scheme, else taken from the request.

routes[].runtime<redirect>.prefix

Syntaxprefix: <string>
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Replaces the matched prefix of the request’s path; unset: taken from the request.

routes[].runtime<redirect>.scheme

Syntaxscheme: http | https
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Replaces the request’s scheme; unset: taken from the request.

routes[].runtime<redirect>.status

Syntaxstatus: <integer>
Default301
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

301, 302, 303, 307 or 308.

routes[].runtime<redirect>.to

Syntaxto: <string>
Defaultnone
Contextroutes[].runtime (type: redirect)
Reloadapplies on reload

Target origin, e.g. https://example.com: scheme and host (and port), no path when keep_path is on. Alternative to the fields scheme, host, port, path and prefix.

routes[].runtime<php>.fastcgi

Syntaxfastcgi: <string>
Defaultnone
Contextroutes[].runtime (type: php)
Reloadapplies on reload

External pool: unix:/path.sock or tcp:host:port. Mutually exclusive with fpm.

routes[].runtime<php>.fpm

Syntaxfpm: {...}
Defaultnone
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Managed PHP-FPM pool settings (workers, ini values); not used with fastcgi.

routes[].runtime<php>.fpm.binary

Syntaxbinary: <string>
Defaultnone
Contextroutes[].runtime<php>.fpm
Reloadapplies on reload

PHP-FPM binary; default: php-fpm on PATH, else the newest versioned one (php-fpm8.4, Alpine’s php-fpm84).

routes[].runtime<php>.fpm.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextroutes[].runtime<php>.fpm
Reloadapplies on reload

Environment passed to PHP (env[...]).

routes[].runtime<php>.fpm.ini

Syntaxini: {<key>: <string>, ...}
Defaultempty
Contextroutes[].runtime<php>.fpm
Reloadapplies on reload

php_admin_value[...] settings, e.g. memory_limit: 256M.

routes[].runtime<php>.fpm.max_requests

Syntaxmax_requests: <integer>
Default500
Contextroutes[].runtime<php>.fpm
Reloadapplies on reload

pm.max_requests; 0 disables recycling.

routes[].runtime<php>.fpm.workers

Syntaxworkers: {...}
Defaultnone
Contextroutes[].runtime<php>.fpm
Reloadapplies on reload

min = pm.start_servers/pm.min_spare_servers, max = pm.max_children.

routes[].runtime<php>.fpm.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextroutes[].runtime<php>.fpm.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

routes[].runtime<php>.fpm.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextroutes[].runtime<php>.fpm.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

routes[].runtime<php>.fpm.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextroutes[].runtime<php>.fpm.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

routes[].runtime<php>.fpm.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextroutes[].runtime<php>.fpm.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

routes[].runtime<php>.front_controller

Syntaxfront_controller: <string>
Defaultnone
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Script that handles requests for paths that do not exist, e.g. /index.php.

routes[].runtime<php>.index

Syntaxindex: [<string>, ...]
Default["index.php","index.html"]
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Index files for directory requests, tried in order.

routes[].runtime<php>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Time to wait for PHP-FPM’s response headers.

routes[].runtime<php>.root

Syntaxroot: <string>
Defaultnone
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Document root; defaults to the application root.

routes[].runtime<php>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Time the managed PHP-FPM pool gets to become ready.

routes[].runtime<php>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextroutes[].runtime (type: php)
Reloadapplies on reload

Time the managed pool gets to exit before it is killed.

routes[].runtime<node>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Command started by scalws (no shell), e.g. [node, server.js]; the application listens on PORT.

routes[].runtime<node>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Environment variables for the process.

routes[].runtime<node>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Optional readiness path; any non-5xx answer counts as ready.

routes[].runtime<node>.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextroutes[].runtime (type: node)
Reloadapplies on reload

unix: a socket under runtime_dir passed as PORT; tcp: a free loopback port.

routes[].runtime<node>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Time to wait for the response headers of the application.

routes[].runtime<node>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Time the process gets to become ready.

routes[].runtime<node>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Time the process gets to exit after SIGTERM before it is killed.

routes[].runtime<node>.upstream

Syntaxupstream: <string>
Defaultnone
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Proxy to a Node.js process managed elsewhere instead of starting one.

routes[].runtime<node>.workers

Syntaxworkers: {...}
Defaultnone
Contextroutes[].runtime (type: node)
Reloadapplies on reload

Number of processes (min); requests are balanced across ready ones.

routes[].runtime<node>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextroutes[].runtime<node>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

routes[].runtime<node>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextroutes[].runtime<node>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

routes[].runtime<node>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextroutes[].runtime<node>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

routes[].runtime<node>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextroutes[].runtime<node>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

routes[].runtime<python>.app

Syntaxapp: <string>
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

module:callable, e.g. app:app or mysite.wsgi:application.

routes[].runtime<python>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Explicit argv. Bind arguments are appended for uvicorn/hypercorn/gunicorn unless the argv already contains {socket} or {port}.

routes[].runtime<python>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Environment variables for the processes.

routes[].runtime<python>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Path requested to decide that a worker is ready and healthy.

routes[].runtime<python>.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextroutes[].runtime (type: python)
Reloadapplies on reload

unix: a socket under runtime_dir; tcp: a free loopback port.

routes[].runtime<python>.mode

Syntaxmode: asgi | wsgi
Defaultrequired
Contextroutes[].runtime (type: python)
Reloadapplies on reload

asgi (uvicorn) or wsgi (gunicorn).

routes[].runtime<python>.process_pool

Syntaxprocess_pool: true | false
Defaultfalse
Contextroutes[].runtime (type: python)
Reloadapplies on reload

scalws runs workers.min..max single-worker server processes itself instead of one server with --workers, so the pool can be scaled and restarted live (ADR-0014). Trades the server’s copy-on-write sharing for scaling.

routes[].runtime<python>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Time to wait for the response headers of the application.

routes[].runtime<python>.server

Syntaxserver: uvicorn | hypercorn | gunicorn
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Default: uvicorn for ASGI, gunicorn for WSGI.

routes[].runtime<python>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Time the processes get to become ready.

routes[].runtime<python>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Time the processes get to exit after SIGTERM before they are killed.

routes[].runtime<python>.upstream

Syntaxupstream: <string>
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Proxy to a Python server managed elsewhere instead of starting one.

routes[].runtime<python>.virtualenv

Syntaxvirtualenv: <string>
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Virtual environment whose server binary and packages are used.

routes[].runtime<python>.workers

Syntaxworkers: {...}
Defaultnone
Contextroutes[].runtime (type: python)
Reloadapplies on reload

Worker processes of the application server (min).

routes[].runtime<python>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextroutes[].runtime<python>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

routes[].runtime<python>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextroutes[].runtime<python>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

routes[].runtime<python>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextroutes[].runtime<python>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

routes[].runtime<python>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextroutes[].runtime<python>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

routes[].runtime<container>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Arguments after the image; {port} is replaced by the port scalws chose.

routes[].runtime<container>.drop_capabilities

Syntaxdrop_capabilities: true | false
Defaultfalse
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Drop all Linux capabilities.

routes[].runtime<container>.engine

Syntaxengine: podman | docker
Defaultpodman
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Container engine: podman or docker.

routes[].runtime<container>.engine_path

Syntaxengine_path: <string>
Defaultnone
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Engine binary; default podman / docker from PATH.

routes[].runtime<container>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Environment variables for the containers.

routes[].runtime<container>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Path requested to decide that a container is ready and healthy.

routes[].runtime<container>.image

Syntaximage: <string>
Defaultrequired
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Image reference, e.g. docker.io/library/nginx:1.27.

routes[].runtime<container>.mounts

Syntaxmounts: [{...}, ...]
Default[]
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Host directories mounted into the containers.

routes[].runtime<container>.mounts[].read_only

Syntaxread_only: true | false
Defaulttrue
Contextroutes[].runtime<container>.mounts[]
Reloadapplies on reload

Mount read-only.

routes[].runtime<container>.mounts[].source

Syntaxsource: <string>
Defaultrequired
Contextroutes[].runtime<container>.mounts[]
Reloadapplies on reload

Host path (absolute).

routes[].runtime<container>.mounts[].target

Syntaxtarget: <string>
Defaultrequired
Contextroutes[].runtime<container>.mounts[]
Reloadapplies on reload

Path inside the container (absolute).

routes[].runtime<container>.network

Syntaxnetwork: bridge | host
Defaultbridge
Contextroutes[].runtime (type: container)
Reloadapplies on reload

bridge: publish port on a loopback port; host: share the host network.

routes[].runtime<container>.port

Syntaxport: <integer>
Defaultnone
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Port the application listens on inside the container (bridge networking).

routes[].runtime<container>.pull

Syntaxpull: missing | always | never
Defaultmissing
Contextroutes[].runtime (type: container)
Reloadapplies on reload

When the image is pulled: missing, always or never.

routes[].runtime<container>.read_only

Syntaxread_only: true | false
Defaultfalse
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Read-only root filesystem (a tmpfs is mounted at /tmp).

routes[].runtime<container>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Time to wait for the response headers of the application.

routes[].runtime<container>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default120s
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Time a container gets to become ready (includes pulling the image).

routes[].runtime<container>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Time a container gets to stop before it is killed.

routes[].runtime<container>.user

Syntaxuser: <string>
Defaultnone
Contextroutes[].runtime (type: container)
Reloadapplies on reload

User the container runs as (--user).

routes[].runtime<container>.workers

Syntaxworkers: {...}
Defaultnone
Contextroutes[].runtime (type: container)
Reloadapplies on reload

Number of containers (min at start; scaled between min and max).

routes[].runtime<container>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextroutes[].runtime<container>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

routes[].runtime<container>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextroutes[].runtime<container>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

routes[].runtime<container>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextroutes[].runtime<container>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

routes[].runtime<container>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextroutes[].runtime<container>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

runtime

Syntaxruntime: {...}
Defaultnone
Contextsite file
Reloadapplies on reload

The full runtime syntax of scalws.yaml, instead of a shorthand above.

runtime<static>.index

Syntaxindex: [<string>, ...]
Default["index.html"]
Contextruntime (type: static)
Reloadapplies on reload

File names served for a directory request, tried in order.

runtime<static>.precompressed

Syntaxprecompressed: true | false
Defaultfalse
Contextruntime (type: static)
Reloadapplies on reload

Serve <file>.br / <file>.gz siblings to clients that accept them.

runtime<static>.root

Syntaxroot: <string>
Defaultnone
Contextruntime (type: static)
Reloadapplies on reload

Document root. Defaults to the application’s root.

runtime<proxy>.backends

Syntaxbackends: [{...}, ...]
Defaultnone
Contextruntime (type: proxy)
Reloadapplies on reload

Weighted split per request across pools (alternative to upstream).

runtime<proxy>.backends[].pool

Syntaxpool: <string>
Defaultnone
Contextruntime<proxy>.backends[]
Reloadapplies on reload

Name of a pool in upstreams; alternative to status.

runtime<proxy>.backends[].status

Syntaxstatus: <integer>
Defaultnone
Contextruntime<proxy>.backends[]
Reloadapplies on reload

Answers this share of the requests with this status (500-599) instead of sending them to a pool.

runtime<proxy>.backends[].weight

Syntaxweight: <integer>
Default1
Contextruntime<proxy>.backends[]
Reloadapplies on reload

Share of requests (0..=1000); 0 sends none.

runtime<proxy>.client

Syntaxclient: hyper | experimental
Defaultnone
Contextruntime (type: proxy)
Reloadapplies on reload

HTTP/1 client used towards this upstream; unset: server.upstream_client.

runtime<proxy>.connect_timeout

Syntaxconnect_timeout: <duration> (e.g. 30s)
Default5s
Contextruntime (type: proxy)
Reloadapplies on reload

Time to establish a connection to the upstream.

runtime<proxy>.preserve_host

Syntaxpreserve_host: true | false
Defaulttrue
Contextruntime (type: proxy)
Reloadapplies on reload

Forward the client’s Host header (default) instead of the upstream authority.

runtime<proxy>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextruntime (type: proxy)
Reloadapplies on reload

Time allowed for the upstream to return response headers.

runtime<proxy>.tls_ca_file

Syntaxtls_ca_file: <string>
Defaultnone
Contextruntime (type: proxy)
Reloadapplies on reload

Extra CA bundle (PEM) trusted for https:// upstreams, in addition to the system roots.

runtime<proxy>.upstream

Syntaxupstream: <string> | {...}
Defaultnone
Contextruntime (type: proxy)
Reloadapplies on reload

http://host:port, https://host:port or unix:/absolute/path.sock (one address, no retries), or {pool: name}: a pool from upstreams.

runtime<proxy>.upstream.pool

Syntaxpool: <string>
Defaultrequired
Contextruntime<proxy>.upstream
Reloadapplies on reload

Name of a pool in upstreams.

runtime<proxy>.websocket

Syntaxwebsocket: true | false
Defaulttrue
Contextruntime (type: proxy)
Reloadapplies on reload

Allow WebSocket upgrades to be tunnelled to this upstream.

runtime<respond>.body

Syntaxbody: <string>
Default“
Contextruntime (type: respond)
Reloadapplies on reload

Response body (at most 64 KiB).

runtime<respond>.content_type

Syntaxcontent_type: <string>
Defaultnone
Contextruntime (type: respond)
Reloadapplies on reload

Content-Type of the response; default text/plain; charset=utf-8.

runtime<respond>.status

Syntaxstatus: <integer>
Default200
Contextruntime (type: respond)
Reloadapplies on reload

HTTP status of the fixed response (200-599).

runtime<redirect>.host

Syntaxhost: <string>
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Replaces the request’s host; unset: taken from the request.

runtime<redirect>.keep_path

Syntaxkeep_path: true | false
Defaulttrue
Contextruntime (type: redirect)
Reloadapplies on reload

Append the request’s path and query to to.

runtime<redirect>.path

Syntaxpath: <string>
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Replaces the request’s path; unset: taken from the request.

runtime<redirect>.port

Syntaxport: <integer>
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Replaces the request’s port; unset: the well-known port of a configured scheme, else taken from the request.

runtime<redirect>.prefix

Syntaxprefix: <string>
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Replaces the matched prefix of the request’s path; unset: taken from the request.

runtime<redirect>.scheme

Syntaxscheme: http | https
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Replaces the request’s scheme; unset: taken from the request.

runtime<redirect>.status

Syntaxstatus: <integer>
Default301
Contextruntime (type: redirect)
Reloadapplies on reload

301, 302, 303, 307 or 308.

runtime<redirect>.to

Syntaxto: <string>
Defaultnone
Contextruntime (type: redirect)
Reloadapplies on reload

Target origin, e.g. https://example.com: scheme and host (and port), no path when keep_path is on. Alternative to the fields scheme, host, port, path and prefix.

runtime<php>.fastcgi

Syntaxfastcgi: <string>
Defaultnone
Contextruntime (type: php)
Reloadapplies on reload

External pool: unix:/path.sock or tcp:host:port. Mutually exclusive with fpm.

runtime<php>.fpm

Syntaxfpm: {...}
Defaultnone
Contextruntime (type: php)
Reloadapplies on reload

Managed PHP-FPM pool settings (workers, ini values); not used with fastcgi.

runtime<php>.fpm.binary

Syntaxbinary: <string>
Defaultnone
Contextruntime<php>.fpm
Reloadapplies on reload

PHP-FPM binary; default: php-fpm on PATH, else the newest versioned one (php-fpm8.4, Alpine’s php-fpm84).

runtime<php>.fpm.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextruntime<php>.fpm
Reloadapplies on reload

Environment passed to PHP (env[...]).

runtime<php>.fpm.ini

Syntaxini: {<key>: <string>, ...}
Defaultempty
Contextruntime<php>.fpm
Reloadapplies on reload

php_admin_value[...] settings, e.g. memory_limit: 256M.

runtime<php>.fpm.max_requests

Syntaxmax_requests: <integer>
Default500
Contextruntime<php>.fpm
Reloadapplies on reload

pm.max_requests; 0 disables recycling.

runtime<php>.fpm.workers

Syntaxworkers: {...}
Defaultnone
Contextruntime<php>.fpm
Reloadapplies on reload

min = pm.start_servers/pm.min_spare_servers, max = pm.max_children.

runtime<php>.fpm.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextruntime<php>.fpm.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

runtime<php>.fpm.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextruntime<php>.fpm.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

runtime<php>.fpm.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextruntime<php>.fpm.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

runtime<php>.fpm.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextruntime<php>.fpm.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

runtime<php>.front_controller

Syntaxfront_controller: <string>
Defaultnone
Contextruntime (type: php)
Reloadapplies on reload

Script that handles requests for paths that do not exist, e.g. /index.php.

runtime<php>.index

Syntaxindex: [<string>, ...]
Default["index.php","index.html"]
Contextruntime (type: php)
Reloadapplies on reload

Index files for directory requests, tried in order.

runtime<php>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextruntime (type: php)
Reloadapplies on reload

Time to wait for PHP-FPM’s response headers.

runtime<php>.root

Syntaxroot: <string>
Defaultnone
Contextruntime (type: php)
Reloadapplies on reload

Document root; defaults to the application root.

runtime<php>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextruntime (type: php)
Reloadapplies on reload

Time the managed PHP-FPM pool gets to become ready.

runtime<php>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextruntime (type: php)
Reloadapplies on reload

Time the managed pool gets to exit before it is killed.

runtime<node>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextruntime (type: node)
Reloadapplies on reload

Command started by scalws (no shell), e.g. [node, server.js]; the application listens on PORT.

runtime<node>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextruntime (type: node)
Reloadapplies on reload

Environment variables for the process.

runtime<node>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextruntime (type: node)
Reloadapplies on reload

Optional readiness path; any non-5xx answer counts as ready.

runtime<node>.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextruntime (type: node)
Reloadapplies on reload

unix: a socket under runtime_dir passed as PORT; tcp: a free loopback port.

runtime<node>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextruntime (type: node)
Reloadapplies on reload

Time to wait for the response headers of the application.

runtime<node>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextruntime (type: node)
Reloadapplies on reload

Time the process gets to become ready.

runtime<node>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextruntime (type: node)
Reloadapplies on reload

Time the process gets to exit after SIGTERM before it is killed.

runtime<node>.upstream

Syntaxupstream: <string>
Defaultnone
Contextruntime (type: node)
Reloadapplies on reload

Proxy to a Node.js process managed elsewhere instead of starting one.

runtime<node>.workers

Syntaxworkers: {...}
Defaultnone
Contextruntime (type: node)
Reloadapplies on reload

Number of processes (min); requests are balanced across ready ones.

runtime<node>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextruntime<node>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

runtime<node>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextruntime<node>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

runtime<node>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextruntime<node>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

runtime<node>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextruntime<node>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

runtime<python>.app

Syntaxapp: <string>
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

module:callable, e.g. app:app or mysite.wsgi:application.

runtime<python>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextruntime (type: python)
Reloadapplies on reload

Explicit argv. Bind arguments are appended for uvicorn/hypercorn/gunicorn unless the argv already contains {socket} or {port}.

runtime<python>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextruntime (type: python)
Reloadapplies on reload

Environment variables for the processes.

runtime<python>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

Path requested to decide that a worker is ready and healthy.

runtime<python>.listen

Syntaxlisten: unix | tcp
Defaultunix
Contextruntime (type: python)
Reloadapplies on reload

unix: a socket under runtime_dir; tcp: a free loopback port.

runtime<python>.mode

Syntaxmode: asgi | wsgi
Defaultrequired
Contextruntime (type: python)
Reloadapplies on reload

asgi (uvicorn) or wsgi (gunicorn).

runtime<python>.process_pool

Syntaxprocess_pool: true | false
Defaultfalse
Contextruntime (type: python)
Reloadapplies on reload

scalws runs workers.min..max single-worker server processes itself instead of one server with --workers, so the pool can be scaled and restarted live (ADR-0014). Trades the server’s copy-on-write sharing for scaling.

runtime<python>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextruntime (type: python)
Reloadapplies on reload

Time to wait for the response headers of the application.

runtime<python>.server

Syntaxserver: uvicorn | hypercorn | gunicorn
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

Default: uvicorn for ASGI, gunicorn for WSGI.

runtime<python>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default30s
Contextruntime (type: python)
Reloadapplies on reload

Time the processes get to become ready.

runtime<python>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextruntime (type: python)
Reloadapplies on reload

Time the processes get to exit after SIGTERM before they are killed.

runtime<python>.upstream

Syntaxupstream: <string>
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

Proxy to a Python server managed elsewhere instead of starting one.

runtime<python>.virtualenv

Syntaxvirtualenv: <string>
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

Virtual environment whose server binary and packages are used.

runtime<python>.workers

Syntaxworkers: {...}
Defaultnone
Contextruntime (type: python)
Reloadapplies on reload

Worker processes of the application server (min).

runtime<python>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextruntime<python>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

runtime<python>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextruntime<python>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

runtime<python>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextruntime<python>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

runtime<python>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextruntime<python>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

runtime<container>.command

Syntaxcommand: [<string>, ...]
Default[]
Contextruntime (type: container)
Reloadapplies on reload

Arguments after the image; {port} is replaced by the port scalws chose.

runtime<container>.drop_capabilities

Syntaxdrop_capabilities: true | false
Defaultfalse
Contextruntime (type: container)
Reloadapplies on reload

Drop all Linux capabilities.

runtime<container>.engine

Syntaxengine: podman | docker
Defaultpodman
Contextruntime (type: container)
Reloadapplies on reload

Container engine: podman or docker.

runtime<container>.engine_path

Syntaxengine_path: <string>
Defaultnone
Contextruntime (type: container)
Reloadapplies on reload

Engine binary; default podman / docker from PATH.

runtime<container>.env

Syntaxenv: {<key>: <string>, ...}
Defaultempty
Contextruntime (type: container)
Reloadapplies on reload

Environment variables for the containers.

runtime<container>.health_path

Syntaxhealth_path: <string>
Defaultnone
Contextruntime (type: container)
Reloadapplies on reload

Path requested to decide that a container is ready and healthy.

runtime<container>.image

Syntaximage: <string>
Defaultrequired
Contextruntime (type: container)
Reloadapplies on reload

Image reference, e.g. docker.io/library/nginx:1.27.

runtime<container>.mounts

Syntaxmounts: [{...}, ...]
Default[]
Contextruntime (type: container)
Reloadapplies on reload

Host directories mounted into the containers.

runtime<container>.mounts[].read_only

Syntaxread_only: true | false
Defaulttrue
Contextruntime<container>.mounts[]
Reloadapplies on reload

Mount read-only.

runtime<container>.mounts[].source

Syntaxsource: <string>
Defaultrequired
Contextruntime<container>.mounts[]
Reloadapplies on reload

Host path (absolute).

runtime<container>.mounts[].target

Syntaxtarget: <string>
Defaultrequired
Contextruntime<container>.mounts[]
Reloadapplies on reload

Path inside the container (absolute).

runtime<container>.network

Syntaxnetwork: bridge | host
Defaultbridge
Contextruntime (type: container)
Reloadapplies on reload

bridge: publish port on a loopback port; host: share the host network.

runtime<container>.port

Syntaxport: <integer>
Defaultnone
Contextruntime (type: container)
Reloadapplies on reload

Port the application listens on inside the container (bridge networking).

runtime<container>.pull

Syntaxpull: missing | always | never
Defaultmissing
Contextruntime (type: container)
Reloadapplies on reload

When the image is pulled: missing, always or never.

runtime<container>.read_only

Syntaxread_only: true | false
Defaultfalse
Contextruntime (type: container)
Reloadapplies on reload

Read-only root filesystem (a tmpfs is mounted at /tmp).

runtime<container>.response_timeout

Syntaxresponse_timeout: <duration> (e.g. 30s)
Default60s
Contextruntime (type: container)
Reloadapplies on reload

Time to wait for the response headers of the application.

runtime<container>.startup_timeout

Syntaxstartup_timeout: <duration> (e.g. 30s)
Default120s
Contextruntime (type: container)
Reloadapplies on reload

Time a container gets to become ready (includes pulling the image).

runtime<container>.stop_timeout

Syntaxstop_timeout: <duration> (e.g. 30s)
Default10s
Contextruntime (type: container)
Reloadapplies on reload

Time a container gets to stop before it is killed.

runtime<container>.user

Syntaxuser: <string>
Defaultnone
Contextruntime (type: container)
Reloadapplies on reload

User the container runs as (--user).

runtime<container>.workers

Syntaxworkers: {...}
Defaultnone
Contextruntime (type: container)
Reloadapplies on reload

Number of containers (min at start; scaled between min and max).

runtime<container>.workers.autoscale

Syntaxautoscale: off | auto | recommend
Defaultrecommend
Contextruntime<container>.workers
Reloadapplies on reload

off, recommend (default) or auto (ADR-0014).

runtime<container>.workers.max

Syntaxmax: <integer>
Defaultrequired
Contextruntime<container>.workers
Reloadapplies on reload

Upper bound when the pool is scaled.

runtime<container>.workers.min

Syntaxmin: <integer>
Defaultrequired
Contextruntime<container>.workers
Reloadapplies on reload

Processes started at the beginning and kept at least.

runtime<container>.workers.target_concurrency

Syntaxtarget_concurrency: <integer>
Defaultnone
Contextruntime<container>.workers
Reloadapplies on reload

Concurrent requests one worker is expected to handle well (utilisation basis).

security

Syntaxsecurity: {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Deny paths and rate limits for the site.

security.deny_paths

Syntaxdeny_paths: [<string>, ...]
Default[]
Contextsecurity
Reloadapplies on reload

Denied paths (added to the profile’s); * matches any characters.

security.ignore_profile_rules

Syntaxignore_profile_rules: true | false
Defaultfalse
Contextsecurity
Reloadapplies on reload

Do not apply the profile’s deny rules.

security.rate_limits

Syntaxrate_limits: [{...}, ...]
Default[]
Contextsecurity
Reloadapplies on reload

Request rates per client address for matching paths (first match applies).

security.rate_limits[].burst

Syntaxburst: <integer>
Defaultnone
Contextsecurity.rate_limits[]
Reloadapplies on reload

Token-bucket burst (default: equal to the rate).

security.rate_limits[].path

Syntaxpath: <string>
Defaultrequired
Contextsecurity.rate_limits[]
Reloadapplies on reload

Path prefix the limit applies to.

security.rate_limits[].requests_per_second

Syntaxrequests_per_second: <integer>
Defaultrequired
Contextsecurity.rate_limits[]
Reloadapplies on reload

Sustained requests per second per client address on this path.

static

Syntaxstatic: true | <string> | [<string>, ...] | {...}
Defaultnone
Contextsite file
Reloadapplies on reload

Static files (the default): true or {index: [...], precompressed: true}.

static.index

Syntaxindex: [<string>, ...]
Default["index.html"]
Contextstatic
Reloadapplies on reload

File names served for a directory request, tried in order.

static.precompressed

Syntaxprecompressed: true | false
Defaultfalse
Contextstatic
Reloadapplies on reload

Serve <file>.br / <file>.gz siblings to clients that accept them.

static.root

Syntaxroot: <string>
Defaultnone
Contextstatic
Reloadapplies on reload

Document root. Defaults to the application’s root.

tenant

Syntaxtenant: <string>
Defaultnone
Contextsite file
Reloadapplies on reload

Tenant (account) of the site; default derived from domain. Sites of one tenant share its resource limits.

tls

Syntaxtls: auto | manual
Defaultnone
Contextsite file
Reloadapplies on reload

auto: certificate via ACME; manual: from the TLS listeners’ certificates. Default: auto when server.acme.enabled, else manual.

user

Syntaxuser: <string>
Defaultnone
Contextsite file
Reloadapplies on reload

Tenant settings (only once per tenant).

www

Syntaxwww: none | alias | redirect
Defaultnone
Contextsite file
Reloadapplies on reload

www.<domain>: not served (none), served as an alias, or redirected to domain.