Allow to set an "root_address" in application.yml. This is used to declare the address of this server, when using proxy.
This commit is contained in:
parent
2e00ddba1b
commit
2656fc0b72
|
@ -31,7 +31,10 @@ public class UriBuilder {
|
|||
baseUrl += sslEnabled.equals("true") ? "s" : "";
|
||||
baseUrl += "://";
|
||||
|
||||
if ( (ip = getPublicIP()) == null )
|
||||
String defined_address = environment.getProperty("server.root_address");
|
||||
if ( (defined_address != null) && !defined_address.isEmpty() )
|
||||
ip = defined_address;
|
||||
else if ( (ip = getPublicIP()) == null )
|
||||
ip = InetAddress.getLoopbackAddress().getHostAddress(); // Non-null.
|
||||
|
||||
baseUrl += ip + ":" + webServerAppCtxt.getWebServer().getPort();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
server:
|
||||
port: 1882
|
||||
# Just a custom address to be shown to the logs and allow for easier testing, when using proxy. This is not the setting to bind the server to this address.
|
||||
root_address:
|
||||
servlet:
|
||||
context-path: /api
|
||||
shutdown: graceful
|
||||
|
|
Loading…
Reference in New Issue