Spring Boot application properties

A typical Spring Boot application uses and configures a single web server. Many Spring Boot application properties are available for configuring the web server for the application.

Open Liberty For the most current information about deploying Spring Boot applications to Liberty, see the Open Liberty website.

Spring Boot web applications typically include the spring-boot-starter-web Spring Boot web starter. This starter provides the dependencies that are needed to run a Spring Boot web application, such as one that uses Spring web model-view-controller (MVC). The web starter enables the configuring of one or more web servers that are used to service the endpoints of the application. For a complete list of Spring Boot application properties, see the 1.5.x and 2.0.x, and 3.x application properties.

Spring Boot application properties for the main web server

server.address
The network address to which the server binds. This address defaults to all.
server.port
The server HTTP port. This address defaults to 8080.
server.server-header
The value to use for the server response header. If this value is empty, no header is set.
server.ssl.*
Settings to control Secure Sockets Layer (SSL) settings for HTTPS.

By default, the main web server for a Spring Boot application uses the Liberty default HTTP endpoint and the default virtual host when the Spring Boot application is deployed to Liberty. Liberty defines the main web server as the first server that is created for the root Spring Boot ApplicationContext. When the Spring Boot application uses the default HTTP endpoint and virtual host, the Spring Boot application properties that are used to configure the main web server are ignored. The Liberty configuration settings for the default HTTP endpoint and default virtual host are used instead.

To override the use of the default HTTP endpoint and default virtual host for the main web server, set the server.liberty.use-default-host application property to false. Also set configuration ID values for the HTTP endpoint and virtual host.
server.liberty.use-default-host
Enables the use of the default host for the main web server. This property defaults to true. Specify false to use the Spring Boot application properties to configure the main web server.

All other Spring Boot application web server instances use the settings that are specified by the application. For example, use Spring Boot Actuators on a different port than the main web server port by configuring the management.port application property. For more information, see Configuring the HTTP endpoint and virtual host for the Spring Boot Actuator.

Configuration IDs for a non-default web server

When you are not using the default HTTP endpoint and default virtual host, Liberty uses the following configuration IDs when it configures a web server for a Spring Boot application.
springBootVirtualHost-<requested port>
The ID configures the virtualHost host for the server to use a *:<requested port> alias.
springBootHttpEndpoint-<requested port>
The ID configures the httpEndpoint endpoint for the server to use a specified host address and HTTP port.
springBootSsl-<requested port>
The ID configures the SSL settings for the httpEndpoint endpoint.
springBootKeyStore-<requested port>
The ID configures the keystore for the SSL settings.
springBootTrustStore-<requested port>
The ID configures the truststore for the SSL settings.

The <requested port> value is the HTTP port that the application requests. Specify the server.port or management.port values to set the <requested port> value.

Use these configuration IDs in the server.xml file to override application settings for the web server. The IDs are ordered by precedence by using the springBootVirtualHost-<requested port> ID that overrides all server endpoint settings with configuration from the server server.xml file.

Use the springBootSsl-<requested port> ID to override the SSL settings but to keep the settings related to the port and address for the server.

Use the springBootKeyStore-<requested port> and springBootTrustStore-<requested port> IDs to override the individual stores that are used for SSL.