EzyHTTP Server Properties

Updated at 1783527555000
EzyHTTP reads server configuration from the application properties loaded by EzyFox Bean. In a normal project you usually put these values in application.properties or application.yaml.
This guide lists the built-in EzyHTTP server properties and explains what each one controls.

Quick example

server.port=8080
server.host=0.0.0.0
server.max_threads=100
server.min_threads=5
server.idle_timeout=150000

cors.enable=true
cors.allowed_origins=https://example.com
cors.allowed_headers=*

resources.enable=true
resources.locations=static,public
resources.upload.enable=true

management.enable=true
management.host=127.0.0.1
management.port=18080

view.template.prefix=templates/
view.template.suffix=.html
view.template.cacheable=true

async.default_timeout=10000

Server properties

PropertyDefault ValueDescription
server.port8080The HTTP port of the main application server.
server.host0.0.0.0The host address bound by the main HTTP server. Use 127.0.0.1 if the server should only accept local traffic.
server.max_threads16The maximum number of worker threads used by the embedded server connector or thread pool.
server.min_threads4The minimum number of worker threads kept by the embedded server connector or thread pool.
server.idle_timeout150000Idle timeout in milliseconds. Tomcat uses this value for session timeout, connection timeout, and keep-alive timeout. Jetty uses it for its queued thread pool idle timeout.
server.context.pathjava.io.tmpdirTomcat only. The base directory used when creating the embedded Tomcat context. If omitted, the JVM temporary directory is used.
server.max_request_body_size2MBMaximum request body size. Tomcat applies it to max post size and max swallow size. Jetty applies it to max form content size.
server.debugfalseEnables debug behavior in EzyHTTP component management.
server.allow_override_urifalseAllows a later request handler registration to override an existing URI mapping.

Multipart upload properties

The multipart properties are used by the servlet multipart configuration.
PropertyDefault ValueDescription
server.multipart.locationjava.io.tmpdirTemporary folder used for multipart file uploads. In Tomcat, a relative path is resolved under the context path. In Jetty, the value is passed directly to the multipart config.
server.multipart.file_size_threshold1MBThe size threshold after which uploaded file content is written to disk.
server.multipart.max_file_size5MBThe maximum size allowed for one uploaded file.
server.multipart.max_request_size5MBThe maximum size allowed for the entire multipart/form-data request.

Compression properties

Compression is enabled by default in both embedded Tomcat and embedded Jetty.
PropertyDefault ValueDescription
server.compression.enabletrueEnables or disables HTTP response compression.
server.compression.min_size32B on Tomcat, empty on JettyMinimum response size required before compression is applied. Examples: 32B, 1KB, 2MB.
server.compression.included_methodsemptyJetty only. Comma-separated HTTP methods that are allowed to use gzip, for example GET,POST.
server.compression.excluded_methodsemptyJetty only. Comma-separated HTTP methods excluded from gzip.
server.compression.included_mime_typesemptyJetty only. Comma-separated MIME types included for gzip, for example text/html,text/css,text/javascript.
server.compression.excluded_mime_typesemptyJetty only. Comma-separated MIME types excluded from gzip, for example image/png,image/tiff.

CORS properties

PropertyDefault ValueDescription
cors.enablefalseEnables the embedded server CORS filter.
cors.allowed_origins*Allowed origins for CORS requests. Use a specific origin in production when possible.
cors.allowed_headers*Allowed request headers for CORS requests.

Management properties

Management APIs are only useful when the management module is included. The embedded server can expose management endpoints on a separate host and port.
PropertyDefault ValueDescription
management.enablefalse in core and Jetty, true in Tomcat bootstrap fieldEnables the management server connector/server. Application context logic treats management as disabled unless this property is true.
management.host0.0.0.0The host address bound by the management server.
management.port18080The port used by the management server when management is enabled.
management.uris_exposefalseExposes application URI information through management support.

Static resource properties

Set resources.enable=true to let EzyHTTP resolve and serve static resources from classpath or file locations.
PropertyDefault ValueDescription
resources.enablefalseEnables static resource resolving and serving.
resources.locationsemptyComma-separated resource locations. If present, this property has priority over resources.location.
resources.locationstaticSingle resource location used when resources.locations is not set.
resources.patternemptyOptional regular expression used to filter resource file paths. When not set, EzyHTTP uses its default file path pattern.
resources.download.capacity100000Maximum number of queued download tasks.
resources.download.thread_pool_sizeavailable processorsNumber of worker threads used by the resource download manager.
resources.download.buffer_size1024Buffer size in bytes for each download worker.
resources.upload.enablefalseEnables resource upload support.
resources.upload.capacity100000Maximum number of queued upload tasks.
resources.upload.thread_pool_sizeavailable processorsNumber of worker threads used by the resource upload manager.
resources.upload.buffer_size1024Buffer size in bytes for each upload worker.

View template properties

These properties are used when EzyHTTP builds the default TemplateResolver.
PropertyDefault ValueDescription
view.template.modeHTMLTemplate mode passed to the view engine.
view.template.prefixtemplates/Template path prefix.
view.template.suffix.htmlTemplate file suffix.
view.template.character_encodingUTF-8Character encoding used when reading templates.
view.template.cache_ttl_ms3600000Template cache time to live in milliseconds.
view.template.cacheabletrueEnables or disables template caching.
view.template.messages_locationmessagesLocation of i18n message files.

Async properties

PropertyDefault ValueDescription
async.default_timeout0Default timeout in milliseconds for asynchronous APIs. A value of 0 means no default timeout is configured by EzyHTTP.

GraphQL properties

These properties are available when the ezyhttp-server-graphql module is included.
PropertyDefault ValueDescription
graphql.enablefalseEnables EzyHTTP GraphQL configuration and registers the GraphQL controller.
graphql.authenticatedfalseRequires authenticated access for GraphQL requests when GraphQL is enabled.

Notes

  • Size values such as 1MB, 5MB, 32B, or 1KB are parsed by EzyHTTP's file size utility.
  • Array properties such as resources.locations and Jetty compression include/exclude lists can be written as comma-separated values in .properties files.
  • YAML nesting also works when your property loader reads YAML. For example, async.default_timeout can be written as:
async:
  default_timeout: 10000

Next

Table Of Contents