diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php
index 04348e2f19d4cedabcdb252e3afa6dea5fa069a6..5eec8b55093f04f8ca905bd8c5c966fd15f06c38 100644
--- a/app/classes/Framadate/Utils.php
+++ b/app/classes/Framadate/Utils.php
@@ -28,7 +28,7 @@ class Utils {
         $dirname = dirname($_SERVER['SCRIPT_NAME']);
         $dirname = $dirname === '\\' ? '/' : $dirname . '/';
         $dirname = str_replace('/admin', '', $dirname);
-        $server_name = $_SERVER['SERVER_NAME'] . $port . $dirname;
+        $server_name = (defined('APP_URL') ? APP_URL : $_SERVER['SERVER_NAME']) . $port . $dirname;
 
         return $scheme . '://' . preg_replace('#//+#', '/', $server_name);
     }
diff --git a/app/inc/config.template.php b/app/inc/config.template.php
index 49481c1e526e733bd2221ec3769deebf79b0714c..a29b57304cf5d6f6cdb1ddad9a2c34a8b0aa3ec6 100644
--- a/app/inc/config.template.php
+++ b/app/inc/config.template.php
@@ -17,6 +17,11 @@
  * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
  */
 
+// Fully qualified domain name of your webserver.
+// If this is unset or empty, the servername is determined automatically.
+// You *have to set this* if you are running Framedate behind a reverse proxy.
+// const APP_URL = '<www.mydomain.fr>';
+
 // Application name
 const NOMAPPLICATION = '<Application name>';