Add property to configure base-path for web endpoints.

Also, move properties corresponding to management server under
`management.server.*`.

Closes gh-10230
This commit is contained in:
Madhura Bhave
2017-10-16 15:05:32 -07:00
parent 68db43cf44
commit d307eba0a3
29 changed files with 184 additions and 96 deletions

View File

@@ -1197,25 +1197,25 @@ content into your application; rather pick only the properties that you need.
endpoints.trace.web.enabled= # Expose the trace endpoint as a Web endpoint.
# MANAGEMENT HTTP SERVER ({sc-spring-boot-actuator}/autoconfigure/web/ManagementServerProperties.{sc-ext}[ManagementServerProperties])
management.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response.
management.address= # Network address that the management endpoints should bind to.
management.context-path= # Management endpoint context-path. For instance `/actuator`
management.port= # Management endpoint HTTP port. Uses the same port as the application by default. Configure a different port to use management-specific SSL.
management.ssl.ciphers= # Supported SSL ciphers. Requires a custom management.port.
management.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. Requires a custom management.port.
management.ssl.enabled= # Enable SSL support. Requires a custom management.port.
management.ssl.enabled-protocols= # Enabled SSL protocols. Requires a custom management.port.
management.ssl.key-alias= # Alias that identifies the key in the key store. Requires a custom management.port.
management.ssl.key-password= # Password used to access the key in the key store. Requires a custom management.port.
management.ssl.key-store= # Path to the key store that holds the SSL certificate (typically a jks file). Requires a custom management.port.
management.ssl.key-store-password= # Password used to access the key store. Requires a custom management.port.
management.ssl.key-store-provider= # Provider for the key store. Requires a custom management.port.
management.ssl.key-store-type= # Type of the key store. Requires a custom management.port.
management.ssl.protocol=TLS # SSL protocol to use. Requires a custom management.port.
management.ssl.trust-store= # Trust store that holds SSL certificates. Requires a custom management.port.
management.ssl.trust-store-password= # Password used to access the trust store. Requires a custom management.port.
management.ssl.trust-store-provider= # Provider for the trust store. Requires a custom management.port.
management.ssl.trust-store-type= # Type of the trust store. Requires a custom management.port.
management.server.add-application-context-header=false # Add the "X-Application-Context" HTTP header in each response. Requires a custom management.server.port.
management.server.address= # Network address that the management endpoints should bind to. Requires a custom management.server.port.
management.server.context-path= # Management endpoint context-path. For instance `/actuator`. Requires a custom management.server.port
management.server.port= # Management endpoint HTTP port. Uses the same port as the application by default. Configure a different port to use management-specific SSL.
management.server.ssl.ciphers= # Supported SSL ciphers. Requires a custom management.port.
management.server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. Requires a custom management.server.port.
management.server.ssl.enabled= # Enable SSL support. Requires a custom management.server.port.
management.server.ssl.enabled-protocols= # Enabled SSL protocols. Requires a custom management.server.port.
management.server.ssl.key-alias= # Alias that identifies the key in the key store. Requires a custom management.server.port.
management.server.ssl.key-password= # Password used to access the key in the key store. Requires a custom management.server.port.
management.server.ssl.key-store= # Path to the key store that holds the SSL certificate (typically a jks file). Requires a custom management.server.port.
management.server.ssl.key-store-password= # Password used to access the key store. Requires a custom management.server.port.
management.server.ssl.key-store-provider= # Provider for the key store. Requires a custom management.server.port.
management.server.ssl.key-store-type= # Type of the key store. Requires a custom management.server.port.
management.server.ssl.protocol=TLS # SSL protocol to use. Requires a custom management.server.port.
management.server.ssl.trust-store= # Trust store that holds SSL certificates. Requires a custom management.server.port.
management.server.ssl.trust-store-password= # Password used to access the trust store. Requires a custom management.server.port.
management.server.ssl.trust-store-provider= # Provider for the trust store. Requires a custom management.server.port.
management.server.ssl.trust-store-type= # Type of the trust store. Requires a custom management.server.port.
# CLOUDFOUNDRY
management.cloudfoundry.enabled=true # Enable extended Cloud Foundry actuator endpoints.
@@ -1229,6 +1229,9 @@ content into your application; rather pick only the properties that you need.
management.endpoints.cors.exposed-headers= # Comma-separated list of headers to include in a response.
management.endpoints.cors.max-age=1800 # How long, in seconds, the response from a pre-flight request can be cached by clients.
# ENDPOINTS JMX CONFIGURATION ({sc-spring-boot-actuator}/autoconfigure/endpoint/ManagementEndpointProperties.{sc-ext}[JmxEndpointExporterProperties])
management.endpoints.web.base-path # Base path for Web endpoints. Relative to server.context-path or management.server.context-path if management.server.port is configured.
# ENDPOINTS JMX CONFIGURATION ({sc-spring-boot-actuator}/autoconfigure/endpoint/infrastructure/JmxEndpointExporterProperties.{sc-ext}[JmxEndpointExporterProperties])
management.endpoints.jmx.domain=org.springframework.boot # Endpoints JMX domain name. Fallback to 'spring.jmx.default-domain' if set.
management.endpoints.jmx.static-names=false # Additional static properties to append to all ObjectNames of MBeans representing Endpoints.

View File

@@ -2116,9 +2116,9 @@ for more details.
=== Change the HTTP port or address of the actuator endpoints
In a standalone application the Actuator HTTP port defaults to the same as the main HTTP
port. To make the application listen on a different port set the external property
`management.port`. To listen on a completely different network address (e.g. if you have
`management.server.port`. To listen on a completely different network address (e.g. if you have
an internal network for management and an external one for user applications) you can
also set `management.address` to a valid IP address that the server is able to bind to.
also set `management.server.address` to a valid IP address that the server is able to bind to.
For more detail look at the
{sc-spring-boot-actuator}/autoconfigure/web/ManagementServerProperties.{sc-ext}[`ManagementServerProperties`]

View File

@@ -567,12 +567,12 @@ is exposed as `/application/health`.
=== Customizing the management endpoint paths
Sometimes it is useful to customize the prefix for the management endpoints.
For example, your application might already use `/application` for another purpose.
You can use the `management.context-path` property to change the prefix for your
You can use the `management.endpoints.web.base-path` property to change the prefix for your
management endpoint:
[source,properties,indent=0]
----
management.context-path=/manage
management.endpoints.web.base-path=/manage
----
The `application.properties` example above will change the endpoint from `/application/{id}` to
@@ -580,7 +580,8 @@ The `application.properties` example above will change the endpoint from `/appli
NOTE: Unless the management port has been configured to
<<production-ready-customizing-management-server-port,expose endpoints using a different
HTTP port>>, `management.context-path` is relative to `server.context-path`.
HTTP port>>, `management.endpoints.web.base-path` is relative to `server.context-path`. If `management.server.port`
is configured, `management.endpoints.web.base-path`, is relative to `management.server.context-path`.
@@ -590,11 +591,11 @@ Exposing management endpoints using the default HTTP port is a sensible choice f
based deployments. If, however, your application runs inside your own data center you
may prefer to expose endpoints using a different HTTP port.
The `management.port` property can be used to change the HTTP port.
The `management.server.port` property can be used to change the HTTP port.
[source,properties,indent=0]
----
management.port=8081
management.server.port=8081
----
Since your management port is often protected by a firewall, and not exposed to the public
@@ -615,7 +616,7 @@ disable the management security in this way, and it might even break the applica
[[production-ready-management-specific-ssl]]
=== Configuring management-specific SSL
When configured to use a custom port, the management server can also be configured with
its own SSL using the various `management.ssl.*` properties. For example, this allows a
its own SSL using the various `management.server.ssl.*` properties. For example, this allows a
management server to be available via HTTP while the main application uses HTTPS:
[source,properties,indent=0]
@@ -624,8 +625,8 @@ management server to be available via HTTP while the main application uses HTTPS
server.ssl.enabled=true
server.ssl.key-store=classpath:store.jks
server.ssl.key-password=secret
management.port=8080
management.ssl.enabled=false
management.server.port=8080
management.server.ssl.enabled=false
----
Alternatively, both the main server and the management server can use SSL but with
@@ -637,10 +638,10 @@ different key stores:
server.ssl.enabled=true
server.ssl.key-store=classpath:main.jks
server.ssl.key-password=secret
management.port=8080
management.ssl.enabled=true
management.ssl.key-store=classpath:management.jks
management.ssl.key-password=secret
management.server.port=8080
management.server.ssl.enabled=true
management.server.ssl.key-store=classpath:management.jks
management.server.ssl.key-password=secret
----
@@ -648,7 +649,7 @@ different key stores:
[[production-ready-customizing-management-server-address]]
=== Customizing the management server address
You can customize the address that the management endpoints are available on by
setting the `management.address` property. This can be useful if you want to
setting the `management.server.address` property. This can be useful if you want to
listen only on an internal or ops-facing network, or to only listen for connections from
`localhost`.
@@ -660,8 +661,8 @@ connections:
[source,properties,indent=0]
----
management.port=8081
management.address=127.0.0.1
management.server.port=8081
management.server.address=127.0.0.1
----
@@ -672,7 +673,7 @@ If you don't want to expose endpoints over HTTP you can set the management port
[source,properties,indent=0]
----
management.port=-1
management.server.port=-1
----