diff --git a/azkaban-common/src/main/java/azkaban/Constants.java b/azkaban-common/src/main/java/azkaban/Constants.java
index fe66d4f..4c1172a 100644
--- a/azkaban-common/src/main/java/azkaban/Constants.java
+++ b/azkaban-common/src/main/java/azkaban/Constants.java
@@ -87,6 +87,14 @@ public class Constants {
public static final String IS_METRICS_ENABLED = "azkaban.is.metrics.enabled";
+ // User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
+ // enduser -> myazkabanhost:443 -> proxy -> localhost:8081
+ // when this parameters set then these parameters are used to generate email links.
+ // if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
+ public static final String AZKABAN_WEBSERVER_EXTERNAL_HOSTNAME = "azkaban.webserver.external_hostname";
+ public static final String AZKABAN_WEBSERVER_EXTERNAL_SSL_PORT = "azkaban.webserver.external_ssl_port";
+ public static final String AZKABAN_WEBSERVER_EXTERNAL_PORT = "azkaban.webserver.external_port";
+
// Hostname for the host, if not specified, canonical hostname will be used
public static final String AZKABAN_SERVER_HOST_NAME = "azkaban.server.hostname";
diff --git a/azkaban-common/src/main/java/azkaban/utils/Emailer.java b/azkaban-common/src/main/java/azkaban/utils/Emailer.java
index ecdb645..41a20a9 100644
--- a/azkaban-common/src/main/java/azkaban/utils/Emailer.java
+++ b/azkaban-common/src/main/java/azkaban/utils/Emailer.java
@@ -19,6 +19,7 @@ package azkaban.utils;
import static java.util.Objects.requireNonNull;
import azkaban.Constants;
+import azkaban.Constants.ConfigurationKeys;
import azkaban.alert.Alerter;
import azkaban.executor.ExecutableFlow;
import azkaban.executor.ExecutableNode;
@@ -74,16 +75,16 @@ public class Emailer extends AbstractMailer implements Alerter {
EmailMessage.setTotalAttachmentMaxSize(getAttachmentMaxSize());
- this.clientHostname = props.getString("jetty.hostname", "localhost");
+ this.clientHostname = props.getString(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_HOSTNAME, props.getString("jetty.hostname", "localhost"));
if (props.getBoolean("jetty.use.ssl", true)) {
this.scheme = HTTPS;
- this.clientPortNumber = Integer.toString(props.getInt("jetty.ssl.port",
- Constants.DEFAULT_SSL_PORT_NUMBER));
+ this.clientPortNumber = Integer.toString(props.getInt(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_SSL_PORT, props.getInt("jetty.ssl.port",
+ Constants.DEFAULT_SSL_PORT_NUMBER)));
} else {
this.scheme = HTTP;
- this.clientPortNumber = Integer.toString(props.getInt("jetty.port",
- Constants.DEFAULT_PORT_NUMBER));
+ this.clientPortNumber = Integer.toString(props.getInt(ConfigurationKeys.AZKABAN_WEBSERVER_EXTERNAL_PORT, props.getInt("jetty.port",
+ Constants.DEFAULT_PORT_NUMBER)));
}
this.testMode = props.getBoolean("test.mode", false);
diff --git a/azkaban-solo-server/src/main/resources/conf/azkaban.properties b/azkaban-solo-server/src/main/resources/conf/azkaban.properties
index bac555e..a09550d 100644
--- a/azkaban-solo-server/src/main/resources/conf/azkaban.properties
+++ b/azkaban-solo-server/src/main/resources/conf/azkaban.properties
@@ -25,6 +25,13 @@ executor.port=12321
# mail settings
mail.sender=
mail.host=
+# User facing web server configurations used to construct the user facing server URLs. They are useful when there is a reverse proxy between Azkaban web servers and users.
+# enduser -> myazkabanhost:443 -> proxy -> localhost:8081
+# when this parameters set then these parameters are used to generate email links.
+# if these parameters are not set then jetty.hostname, and jetty.port(if ssl configured jetty.ssl.port) are used.
+# azkaban.webserver.external_hostname=myazkabanhost.com
+# azkaban.webserver.external_ssl_port=443
+# azkaban.webserver.external_port=8081
job.failure.email=
job.success.email=
lockdown.create.projects=false