diff --git a/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java b/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java index e11aeb8..626b87b 100644 --- a/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java +++ b/src/main/java/org/gcube/smartgears/handler/resourceregistry/EServiceManager.java @@ -469,15 +469,15 @@ public class EServiceManager extends ApplicationLifecycleHandler { ContainerConfiguration container = context.container().configuration(); String baseAddress; if (configuration.proxied()){ - String protocol = container.proxyAddress().secure()? "https://": "http://"; - int port = container.proxyAddress().port(); + String protocol = configuration.proxyAddress().protocol(); + String port = configuration.proxyAddress().port()!=null?":"+configuration.proxyAddress().port():""; - baseAddress=String.format("%s%s:%d%s", protocol , container.proxyAddress().hostname(), port, context.application().getContextPath()); + baseAddress=String.format("%s://%s%s%s", protocol , configuration.proxyAddress().hostname(), port,context.application().getContextPath()); } else { - String protocol = configuration.secure()? "https://": "http://"; - int port = configuration.secure()?container.securePort(): container.port(); + String protocol = container.protocol(); + int port = container.port(); - baseAddress=String.format("%s%s:%d%s", protocol , container.hostname(), port, context.application().getContextPath()); + baseAddress=String.format("%s://%s:%d%s", protocol , container.hostname(), port,context.application().getContextPath()); } return baseAddress; }