diff --git a/src/main/java/caosdb/server/CaosDBServer.java b/src/main/java/caosdb/server/CaosDBServer.java
index 55232e2efb98d4d05ee9677ee01225931a9ef7d2..fdad2c26ce2524dc8db43e49637fd635b610ba91 100644
--- a/src/main/java/caosdb/server/CaosDBServer.java
+++ b/src/main/java/caosdb/server/CaosDBServer.java
@@ -315,6 +315,13 @@ public class CaosDBServer extends Application {
           Integer.parseInt(getServerProperty(ServerProperties.KEY_SERVER_PORT_HTTPS));
       final int port_http =
           Integer.parseInt(getServerProperty(ServerProperties.KEY_SERVER_PORT_HTTP));
+      int port_https_ext;
+      try {
+        port_https_ext =
+          Integer.parseInt(getServerProperty(ServerProperties.KEY_SERVER_PORT_HTTPS_EXTERNAL));
+      } catch (NumberFormatException e) {
+        port_https_ext = port_https;
+      }
       final int initialConnections =
           Integer.parseInt(getServerProperty(ServerProperties.KEY_INITIAL_CONNECTIONS));
       final int maxTotalConnections =
@@ -326,7 +333,8 @@ public class CaosDBServer extends Application {
       if (INSECURE) {
         runHTTPServer(port_http, initialConnections, maxTotalConnections);
       } else {
-        runHTTPSServer(port_https, port_http, initialConnections, maxTotalConnections);
+          runHTTPSServer(port_https, port_http, port_https_ext,
+                         initialConnections, maxTotalConnections);
       }
       initShutDownHook();
     } catch (final Exception e) {
@@ -403,6 +411,7 @@ public class CaosDBServer extends Application {
   private static void runHTTPSServer(
       final int port_https,
       final int port_http,
+      final int port_https_ext,
       final int initialConnections,
       final int maxTotalConnections)
       throws Exception {
@@ -424,10 +433,11 @@ public class CaosDBServer extends Application {
 
     // redirector http to https
     if (port_http != 0) {
+      System.out.println("Redirecting to " + port_https_ext);
       component
           .getServers()
           .add(Protocol.HTTP, port_http)
-          .setNext(new HttpToHttpsRedirector(port_https));
+          .setNext(new HttpToHttpsRedirector(port_https_ext));
     }
 
     // set initial and maximal connections
diff --git a/src/main/java/caosdb/server/HttpToHttpsRedirector.java b/src/main/java/caosdb/server/HttpToHttpsRedirector.java
index acf2db75605a728140330a600767ea90b396f742..4f5c44b10211b14acfe8fa44761b83b46e640108 100644
--- a/src/main/java/caosdb/server/HttpToHttpsRedirector.java
+++ b/src/main/java/caosdb/server/HttpToHttpsRedirector.java
@@ -27,10 +27,17 @@ import org.restlet.Response;
 import org.restlet.Restlet;
 import org.restlet.data.Reference;
 
+/**
+ * Sends a permanent redirect response.
+ */
 public class HttpToHttpsRedirector extends Restlet {
 
   private final int port;
 
+ /**
+  * @author Timm Fitschen
+  * @param httpsPort The port to which the redirect should point.
+  */
   public HttpToHttpsRedirector(final int httpsPort) {
     this.port = httpsPort;
   }
diff --git a/src/main/java/caosdb/server/ServerProperties.java b/src/main/java/caosdb/server/ServerProperties.java
index 52c7c33c8e8ac33f1f917a9923ee61bac1840121..9673eff2816684ff572189093bd4c24ed333b550 100644
--- a/src/main/java/caosdb/server/ServerProperties.java
+++ b/src/main/java/caosdb/server/ServerProperties.java
@@ -61,6 +61,7 @@ public class ServerProperties extends Properties {
 
   public static final String KEY_SERVER_PORT_HTTPS = "SERVER_PORT_HTTPS";
   public static final String KEY_SERVER_PORT_HTTP = "SERVER_PORT_HTTP";
+  public static final String KEY_SERVER_PORT_HTTPS_EXTERNAL = "SERVER_PORT_HTTPS_EXTERNAL";
 
   public static final String KEY_HTTPS_ENABLED_PROTOCOLS = "HTTPS_ENABLED_PROTOCOLS";
   public static final String KEY_HTTPS_DISABLED_PROTOCOLS = "HTTPS_DISABLED_PROTOCOLS";