EzyHTTP Server Properties
Updated at 1783527555000EzyHTTP 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
| Property | Default Value | Description |
|---|---|---|
server.port | 8080 | The HTTP port of the main application server. |
server.host | 0.0.0.0 | The host address bound by the main HTTP server. Use 127.0.0.1 if the server should only accept local traffic. |
server.max_threads | 16 | The maximum number of worker threads used by the embedded server connector or thread pool. |
server.min_threads | 4 | The minimum number of worker threads kept by the embedded server connector or thread pool. |
server.idle_timeout | 150000 | Idle 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.path | java.io.tmpdir | Tomcat only. The base directory used when creating the embedded Tomcat context. If omitted, the JVM temporary directory is used. |
server.max_request_body_size | 2MB | Maximum request body size. Tomcat applies it to max post size and max swallow size. Jetty applies it to max form content size. |
server.debug | false | Enables debug behavior in EzyHTTP component management. |
server.allow_override_uri | false | Allows a later request handler registration to override an existing URI mapping. |
Multipart upload properties
The multipart properties are used by the servlet multipart configuration.
| Property | Default Value | Description |
|---|---|---|
server.multipart.location | java.io.tmpdir | Temporary 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_threshold | 1MB | The size threshold after which uploaded file content is written to disk. |
server.multipart.max_file_size | 5MB | The maximum size allowed for one uploaded file. |
server.multipart.max_request_size | 5MB | The maximum size allowed for the entire multipart/form-data request. |
Compression properties
Compression is enabled by default in both embedded Tomcat and embedded Jetty.
| Property | Default Value | Description |
|---|---|---|
server.compression.enable | true | Enables or disables HTTP response compression. |
server.compression.min_size | 32B on Tomcat, empty on Jetty | Minimum response size required before compression is applied. Examples: 32B, 1KB, 2MB. |
server.compression.included_methods | empty | Jetty only. Comma-separated HTTP methods that are allowed to use gzip, for example GET,POST. |
server.compression.excluded_methods | empty | Jetty only. Comma-separated HTTP methods excluded from gzip. |
server.compression.included_mime_types | empty | Jetty only. Comma-separated MIME types included for gzip, for example text/html,text/css,text/javascript. |
server.compression.excluded_mime_types | empty | Jetty only. Comma-separated MIME types excluded from gzip, for example image/png,image/tiff. |
CORS properties
| Property | Default Value | Description |
|---|---|---|
cors.enable | false | Enables 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.
| Property | Default Value | Description |
|---|---|---|
management.enable | false in core and Jetty, true in Tomcat bootstrap field | Enables the management server connector/server. Application context logic treats management as disabled unless this property is true. |
management.host | 0.0.0.0 | The host address bound by the management server. |
management.port | 18080 | The port used by the management server when management is enabled. |
management.uris_expose | false | Exposes 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.| Property | Default Value | Description |
|---|---|---|
resources.enable | false | Enables static resource resolving and serving. |
resources.locations | empty | Comma-separated resource locations. If present, this property has priority over resources.location. |
resources.location | static | Single resource location used when resources.locations is not set. |
resources.pattern | empty | Optional regular expression used to filter resource file paths. When not set, EzyHTTP uses its default file path pattern. |
resources.download.capacity | 100000 | Maximum number of queued download tasks. |
resources.download.thread_pool_size | available processors | Number of worker threads used by the resource download manager. |
resources.download.buffer_size | 1024 | Buffer size in bytes for each download worker. |
resources.upload.enable | false | Enables resource upload support. |
resources.upload.capacity | 100000 | Maximum number of queued upload tasks. |
resources.upload.thread_pool_size | available processors | Number of worker threads used by the resource upload manager. |
resources.upload.buffer_size | 1024 | Buffer size in bytes for each upload worker. |
View template properties
These properties are used when EzyHTTP builds the default
TemplateResolver.| Property | Default Value | Description |
|---|---|---|
view.template.mode | HTML | Template mode passed to the view engine. |
view.template.prefix | templates/ | Template path prefix. |
view.template.suffix | .html | Template file suffix. |
view.template.character_encoding | UTF-8 | Character encoding used when reading templates. |
view.template.cache_ttl_ms | 3600000 | Template cache time to live in milliseconds. |
view.template.cacheable | true | Enables or disables template caching. |
view.template.messages_location | messages | Location of i18n message files. |
Async properties
| Property | Default Value | Description |
|---|---|---|
async.default_timeout | 0 | Default 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.| Property | Default Value | Description |
|---|---|---|
graphql.enable | false | Enables EzyHTTP GraphQL configuration and registers the GraphQL controller. |
graphql.authenticated | false | Requires authenticated access for GraphQL requests when GraphQL is enabled. |
Notes
- Size values such as
1MB,5MB,32B, or1KBare parsed by EzyHTTP's file size utility. - Array properties such as
resources.locationsand Jetty compression include/exclude lists can be written as comma-separated values in.propertiesfiles. - YAML nesting also works when your property loader reads YAML. For example,
async.default_timeoutcan be written as:
async: default_timeout: 10000
Next
You can see how to serve static files with EzyHTTP.