6.5 Host Resolution
You may need to resolve the host name of the current server. Micronaut ships with an implementation of the HttpHostResolver interface.
The default implementation will look for host information in the following places in order:
The supplied configuration
The
Forwarded
headerThe
X-Forwarded-
headersThe
Host
headerThe properties on the request URI
The properties on the embedded server URI
The behavior of which headers to pull the relevant data can be changed with the following configuration:
Property | Type | Description |
---|---|---|
| java.lang.String | The header name that stores the host |
| java.lang.String | The header name that stores the protocol |
| java.lang.String | The header name that stores the port |
| boolean | True if the host header supports a port |