All properties

Every property spring_boot_starter_web reads, grouped by prefix. Each row gives the key, its type and allowed values, its default, what it does, and the page that explains it in detail.

Why

Most of the starter is configured with properties, not code. This page is the one place where all of them are listed, so you can check a key, its default and its unit without reading every page. The starter's own metadata (lib/spring_gen/spring_metadata.json) lists the same 76 keys, so editors with completion offer them too.

Example

A realistic configuration of a shop's backend behind a TLS proxy, with uploads, sessions and a built web app.

# lib/resources/application.yml
server:
  port: 8080
  address: 127.0.0.1
  shutdown: graceful
  context-path: /shop
  max-http-request-body-size: 10MB
  connection-timeout: 30s
  request-timeout: 15s
  max-concurrent-requests: 500
  retry-after: 2s
  forward-headers-strategy: native
  forward-headers:
    trusted-proxies: 127.0.0.1,::1
  compression:
    enabled: true
    mime-types: text/html,text/css,text/javascript,application/javascript,application/json,application/problem+json
    min-response-size: 2KB
  mime-mappings:
    wasm: application/wasm
  session:
    timeout: 30m
    max-sessions: 10000
    cookie:
      name: SHOPSESSION
      path: /shop
      http-only: true
      same-site: lax
  websocket:
    max-text-message-size: 64KB
    max-binary-message-size: 1MB
    send-buffer-size-limit: 512KB
    send-time-limit: 10s
spring:
  main:
    register-shutdown-hook: true
  lifecycle:
    timeout-per-shutdown-phase: 20s
  mvc:
    log-request-details: false
    static-path-pattern: /**
    async:
      request-timeout: 30m
    sse:
      heartbeat-interval: 15s
  web:
    multipart:
      enabled: true
      max-file-size: 5MB
      max-request-size: 20MB
      max-part-count: 20
      file-size-threshold: 64KB
      location: /var/tmp/shop-uploads
    resources:
      static-locations: file:build/web/
      add-mappings: true
      spa-fallback: true
      directory-index: true
      cache:
        use-last-modified: true
        cachecontrol:
          max-age: 1h
          cache-public: true
          stale-while-revalidate: 1m
      chain:
        compressed: true

The same in .properties:

# lib/resources/application.properties
server.port=8080
server.address=127.0.0.1
server.shutdown=graceful
server.context-path=/shop
server.max-http-request-body-size=10MB
server.connection-timeout=30s
server.request-timeout=15s
server.max-concurrent-requests=500
server.retry-after=2s
server.forward-headers-strategy=native
server.forward-headers.trusted-proxies=127.0.0.1,::1
server.compression.enabled=true
server.compression.mime-types=text/html,text/css,text/javascript,application/javascript,application/json,application/problem+json
server.compression.min-response-size=2KB
server.mime-mappings.wasm=application/wasm
server.session.timeout=30m
server.session.max-sessions=10000
server.session.cookie.name=SHOPSESSION
server.session.cookie.path=/shop
server.session.cookie.http-only=true
server.session.cookie.same-site=lax
server.websocket.max-text-message-size=64KB
server.websocket.max-binary-message-size=1MB
server.websocket.send-buffer-size-limit=512KB
server.websocket.send-time-limit=10s
spring.main.register-shutdown-hook=true
spring.lifecycle.timeout-per-shutdown-phase=20s
spring.mvc.log-request-details=false
spring.mvc.static-path-pattern=/**
spring.mvc.async.request-timeout=30m
spring.mvc.sse.heartbeat-interval=15s
spring.web.multipart.enabled=true
spring.web.multipart.max-file-size=5MB
spring.web.multipart.max-request-size=20MB
spring.web.multipart.max-part-count=20
spring.web.multipart.file-size-threshold=64KB
spring.web.multipart.location=/var/tmp/shop-uploads
spring.web.resources.static-locations=file:build/web/
spring.web.resources.add-mappings=true
spring.web.resources.spa-fallback=true
spring.web.resources.directory-index=true
spring.web.resources.cache.use-last-modified=true
spring.web.resources.cache.cachecontrol.max-age=1h
spring.web.resources.cache.cachecontrol.cache-public=true
spring.web.resources.cache.cachecontrol.stale-while-revalidate=1m
spring.web.resources.chain.compressed=true

spring.main.register-shutdown-hook and spring.lifecycle.timeout-per-shutdown-phase belong to spring_boot_dart, not to this starter. They are in the example because a server needs them.

Writing values

See @ConfigurationProperties and Environment.

server.*: the server

Key Type Default Meaning
server.port int 8080 The port to listen on. 0 picks a free port, published in local.server.port. A port in use fails the start with Web server failed to start. Port 8080 was already in use. → The embedded server
server.address String: IP address or host name all interfaces; 127.0.0.1 in Flutter apps The address to listen on. localhost is 127.0.0.1; a host name is looked up at start. → The embedded server
server.shutdown graceful / immediate graceful graceful takes no new connections and lets running requests finish within spring.lifecycle.timeout-per-shutdown-phase; immediate cuts them. → Shutdown
server.context-path String none A prefix of every path (/shop). It is removed before routing; other paths get a 404. A missing leading / is added, trailing ones dropped. → The embedded server
server.max-http-request-body-size DataSize, or -1 10MB A larger request body is answered with 413, whatever its type. Uploads use spring.web.multipart.max-request-size instead. -1: no limit. → The embedded server
server.connection-timeout Duration; 0 or less: none 60s How long a request body may send nothing before a 408 (the connection then closes); also how long an idle keep-alive connection stays open. → Timeouts
server.request-timeout Duration; 0 or less: none none The longest the filters and the handler may take to start the answer, else a 503; the request's RequestDeadline. Streams and WebSocket handshakes are not timed. → Timeouts
server.max-concurrent-requests int; 0 or less: none none The most requests an isolate answers at a time, event streams not counted. One past it is answered 503 with Retry-After at once, instead of waiting behind the others; its connection stays open for the next try. → Overload
server.max-connections int; 0 or less: none none The most connections an isolate keeps open. While it has more, every request is answered 503 with Retry-After and its connection closed, until the number is back under the limit. → Overload
server.retry-after Duration 1s The Retry-After of those 503, in whole seconds, at least 1. → Overload
server.mime-mappings.* map: extension → media type empty More Content-Types of static files by extension, on top of the built-in ones; a listed extension wins. Matched in any case. Example: server.mime-mappings.wasm=application/wasm. → The embedded server, Static resources

server.ssl.*: TLS

TLS is on when server.ssl.certificate is set and server.ssl.enabled is not false.

Key Type Default Meaning
server.ssl.enabled bool true false ignores the other server.ssl.* keys: plain HTTP. → TLS
server.ssl.certificate String: a file path none The certificate chain, a PEM file. Setting it turns TLS on. Not a resources: location. → TLS
server.ssl.certificate-private-key String: a file path none The private key, a PEM file. Required with certificate, else the start fails with server.ssl.certificate needs server.ssl.certificate-private-key. → TLS
server.ssl.key-password String none The password of an encrypted private key. → TLS
server.ssl.trust-certificate String: a file path none The certificates client certificates must be signed by, a PEM file. Used with client-auth. → TLS
server.ssl.client-auth none / want / need none Asks clients for a certificate. want: served anyway without one; need: a request without one gets a 403. → TLS

server.compression.*: gzip

Key Type Default Meaning
server.compression.enabled bool false Gzip the answers of mime-types from min-response-size on (or of unknown length), for clients that accept gzip. Never partial content, an answer with a Content-Encoding, or one with a strong ETag. Adds Vary: Accept-Encoding. → Compression
server.compression.mime-types List<String> of media types; text/* allowed text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json, application/xml The media types compressed. Setting it replaces the list. Add text/event-stream to compress event streams. → Compression
server.compression.min-response-size DataSize 2KB The smallest Content-Length compressed. → Compression

server.isolates.*: the pool of isolates

Every isolate of the pool runs the whole application with its own beans. Read What changes with more than one isolate before raising count.

Key Type Default Meaning
server.isolates.count a number, or auto 1 How many isolates serve the port at the start. auto: one per processor core. 1: the application's own isolate only. → A pool of isolates
server.isolates.drain-timeout Duration 30s How long an isolate that leaves the pool may finish its requests before it is stopped anyway. → Scaling the isolates
server.isolates.scaling manual / auto manual Who changes the number of isolates while the server runs: only the application, through the IsolateScaler bean, or the scaling policy too. → Scaling the isolates
server.isolates.min int 1 The fewest isolates scaling goes down to. → Scaling the isolates
server.isolates.max int not set: the processor cores, or count when that is more The most isolates scaling goes up to. Above one, the server has a pool (and an IsolateScaler) even with count: 1. → Scaling the isolates
server.isolates.scale-up-lag Duration 5ms How late the isolates' event loops run on average when the default policy calls them overloaded. → Scaling the isolates
server.isolates.scale-up-after Duration 5s How long the isolates must be late before the default policy adds some. → Scaling the isolates
server.isolates.scale-down-after Duration 2m How long the isolates must be free before the default policy removes one. → Scaling the isolates
server.isolates.cooldown Duration 15s The pause after a scaling step before the policy is asked again. → Scaling the isolates

server.max-concurrent-requests, server.max-connections and server.session.max-sessions are per isolate.

server.session.*: sessions

Key Type Default Meaning
server.session.timeout Duration; seconds without a unit 30m How long a session lives without a request. server.session.timeout=90 is 90 seconds. → Sessions
server.session.max-sessions int, or -1 10000 The most sessions kept at once. At the limit, expired sessions are removed first; if the store is still full, the new session is refused with a 503 and a warning Session limit 10000 reached: refused a new session (raise server.session.max-sessions). A live session is never pushed out. -1: no limit. → Sessions
server.session.cookie.name String JSESSIONID The name of the session cookie. → Sessions
server.session.cookie.domain String none The cookie's Domain. None: the cookie goes back only to the host that set it. → Sessions
server.session.cookie.path String server.context-path, or / The cookie's Path. → Sessions
server.session.cookie.http-only bool true Sends HttpOnly: scripts cannot read the cookie. → Sessions
server.session.cookie.secure bool not set: secure when the request was Sends Secure: HTTPS only. Not set: Secure on HTTPS requests (also behind a TLS proxy with server.forward-headers-strategy). → Sessions
server.session.cookie.same-site lax / strict / none / unset lax The cookie's SameSite. unset sends none; browsers want Secure with none. → Sessions

server.websocket.*: WebSocket sessions

Key Type Default Meaning
server.websocket.max-text-message-size DataSize, or -1 8KB The largest text message a session reads, in UTF-8 bytes; a larger one closes the session with 1009. → WebSocket
server.websocket.max-binary-message-size DataSize, or -1 8KB The largest binary message a session reads; a larger one closes the session with 1009. → WebSocket
server.websocket.send-buffer-size-limit DataSize, or -1 512KB How much may wait to be sent to a slow client (pongs included); past it the connection is dropped with close status 4500. → WebSocket
server.websocket.send-time-limit Duration, or -1 10s How long what was sent may take to leave; past it the connection is dropped with 4500. → WebSocket

server.forward-headers*: behind a reverse proxy

Key Type Default Meaning
server.forward-headers-strategy none / native / framework none native and framework (the same here) apply Forwarded or X-Forwarded-Proto, -Host, -Port, -For from trusted proxies: the scheme, host, port and client address. → Reverse proxy
server.forward-headers.trusted-proxies List<String> of IP addresses and CIDR ranges 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 100.64.0.0/10, ::1/128, fc00::/7, fe80::/10 Whose forwarded headers are believed. Setting it replaces the default list. An invalid entry stops the start (Not an address or range: ...). → Reverse proxy

spring.mvc.*: requests, streams, static path

Key Type Default Meaning
spring.mvc.log-request-details bool false Shows the values of parameters and headers in the dispatcher's debug and trace lines. Credentials stay masked. → The embedded server
spring.mvc.static-path-pattern String: a path pattern /** The path the static resources of spring.web.resources.static-locations are served under: /assets/** serves static/app.css as /assets/app.css. The welcome page only with /**. → Static resources
spring.mvc.async.request-timeout Duration none The timeout of an SseEmitter created without one: its onTimeout callbacks run, then it completes. Not for Stream results. → Server-sent events, Timeouts
spring.mvc.sse.heartbeat-interval Duration none Sends a comment line in every open event stream at this interval, so proxies keep idle streams open. This starter's own key. → Server-sent events

spring.web.multipart.*: uploads

Key Type Default Meaning
spring.web.multipart.enabled bool true false: multipart/* requests are not parsed, and @RequestPart parameters answer 400. → Uploads
spring.web.multipart.max-file-size DataSize, or -1 1MB The largest file (or other part) of an upload; above it a 413 (MaxUploadSizeExceededException). → Uploads
spring.web.multipart.max-request-size DataSize, or -1 10MB The largest multipart request as a whole; above it a 413. Replaces server.max-http-request-body-size for uploads. → Uploads
spring.web.multipart.max-part-count int, or -1 50 The most parts (files and fields) of a multipart request; above it a 413. Spring Boot's server.tomcat.max-part-count. → Uploads
spring.web.multipart.file-size-threshold DataSize 0B Files above this size go to a temporary file; smaller ones stay in memory. With 0B every file goes to disk (to memory where there is no dart:io). → Uploads
spring.web.multipart.location String: a directory path the system's temporary directory Where the private directory (0700) of the temporary files is made. The files have random names and are deleted when the request ends or fails. → Uploads

spring.web.resources.*: static resources

Key Type Default Meaning
spring.web.resources.static-locations List<String> of resources: and file: locations resources:static/, resources:public/ Where static files are read from, in order; the first location with the file wins. resources: is a folder of lib/resources/ (embedded, files up to 1 MB), file: a directory read at run time. The root resources: or another prefix stops the start. → Static resources
spring.web.resources.add-mappings bool true false turns off the default mapping and the welcome page. Mappings of WebMvcConfigurer.addResourceHandlers stay. → Static resources
spring.web.resources.spa-fallback bool false A browser's GET or HEAD of a path with no file and no handler, whose last segment has no extension and whose Accept names text/html, gets index.html instead of a 404 (never under .well-known/). This starter's own key. → Static resources
spring.web.resources.directory-index bool false A path with no file whose folder holds an index.html gets it: /guide and /guide/ get guide/index.html. Asked before spa-fallback. This starter's own key. → Static resources
spring.web.resources.chain.compressed bool false Serves app.js.br (first) or app.js.gz next to app.js to clients that accept it, with Content-Encoding and Vary: Accept-Encoding. → Static resources

spring.web.resources.cache.*

Key Type Default Meaning
spring.web.resources.cache.period Duration; seconds without a unit none: no Cache-Control Cache-Control: max-age=<seconds>; 0 sends no-store. Any cachecontrol.* key replaces it. → Static resources
spring.web.resources.cache.use-last-modified bool true Sends Last-Modified and answers If-Modified-Since with 304. → Static resources

spring.web.resources.cache.cachecontrol.*

When any of these keys is set, they make the Cache-Control header and cache.period is not used. no-store wins over no-cache, which wins over max-age; the other directives are added after it. A boolean key does something only when true.

Key Type Default Meaning
spring.web.resources.cache.cachecontrol.max-age Duration; seconds without a unit none max-age: how long the answer may be reused without asking the server. → Static resources
spring.web.resources.cache.cachecontrol.no-cache bool none no-cache: reused only after the server confirmed it. → Static resources
spring.web.resources.cache.cachecontrol.no-store bool none no-store: never stored. Wins over no-cache and max-age. → Static resources
spring.web.resources.cache.cachecontrol.must-revalidate bool none must-revalidate: once stale, not used without asking the server. → Static resources
spring.web.resources.cache.cachecontrol.no-transform bool none no-transform: proxies must not change the content. → Static resources
spring.web.resources.cache.cachecontrol.cache-public bool none public: shared caches (CDNs, proxies) may store the answer too. → Static resources
spring.web.resources.cache.cachecontrol.cache-private bool none private: only the user's own cache may store the answer. → Static resources
spring.web.resources.cache.cachecontrol.proxy-revalidate bool none proxy-revalidate: must-revalidate for shared caches only. → Static resources
spring.web.resources.cache.cachecontrol.s-max-age Duration; seconds without a unit none s-maxage: how long shared caches may keep the answer. → Static resources
spring.web.resources.cache.cachecontrol.stale-while-revalidate Duration; seconds without a unit none stale-while-revalidate: how long a stale answer may be used while a fresh one is fetched. → Static resources
spring.web.resources.cache.cachecontrol.stale-if-error Duration; seconds without a unit none stale-if-error: how long a stale answer may be used when the server fails. → Static resources

spring.web.rate-limit.*: rate limiting

Off until rules has a rule or enabled is true. Every key, with its type and default, is on its page: → Rate limiting.

Key Type Default Meaning
spring.web.rate-limit.enabled bool not set: on when rules has a rule Whether requests are limited. → Rate limiting
spring.web.rate-limit.rules[n].* list empty The rules: path, methods, key, limit, burst, name, on-store-failure. → Rate limiting
spring.web.rate-limit.store memory / primary-isolate / jdbc / procedure / d1 the most specific the application has Where the buckets are kept. → Rate limiting
spring.web.rate-limit.on-store-failure deny / allow deny What a request gets when the store cannot be reached: a 503, or through and not counted.
spring.web.rate-limit.verify-store bool true Whether the store is asked at startup that its table, function or binding is there; missing, the application does not start.
spring.web.rate-limit.trusted-proxies list of addresses and CIDR ranges empty The reverse proxies whose client-address-header is read. → Rate limiting

spring.web.debug.*: debug features

Each is in the build only when asked for: the generator reads the enabled key from application.yml or application.properties when build_runner runs.

Key Type Default Meaning
spring.web.debug.qps.enabled bool false true: the build has the filter that counts the requests and RequestRates, which logs requests per second and answers the actuator's qps endpoint. Without it, none of that code. → Requests per second
spring.web.debug.qps.log-interval Duration 10s The length of a window: how often the rate is worked out and logged. 0: nothing is logged, and a window is the time between two reads of /actuator/qps/now. → Requests per second

spring.main.* and spring.test.*: whether a server runs

Key Type Default Meaning
spring.main.web-application-type String: none, or anything else not set: a server starts none (any case): the web beans and MockMvc exist, but no server starts. Any other value starts it. → The embedded server
spring.test.web-environment mock / random-port / defined-port / none not set: a server starts Set by the test support (springBootTest, ApplicationContextRunner), not by you. Only random-port (port 0) and defined-port (server.port) start a server. → The embedded server, Testing

local.server.*: written by the server

Key Type Default Meaning
local.server.port int set once the server listens The port the server really listens on (also in WebServerInitializedEvent). Read it; setting it does nothing. → The embedded server

Keys that are not read

These Spring Boot keys have no effect here, or stop the start:

Key Here
server.servlet.* (context-path, session.*) stop the start: use server.context-path, server.session.*
spring.servlet.multipart.* stop the start: use spring.web.multipart.*
server.http2.enabled not read: dart:io speaks HTTP/1.1
server.max-http-request-header-size not read
server.ssl.key-store, trust-store, bundle, protocol, ciphers not read: PEM files only
server.compression.excluded-user-agents not read
server.error.*, spring.mvc.problemdetails.enabled not read: errors are always ProblemDetails
spring.web.cors.* not read: CORS is set in code (see CORS)
spring.web.resources.chain.enabled, chain.cache, chain.strategy.* not read
server.tomcat.*, server.jetty.*, server.undertow.*, server.netty.* not read

In Spring (Java)

The keys follow Spring Boot's ServerProperties, WebMvcProperties, MultipartProperties and WebProperties.Resources. Differences that matter:

See also