Skip to content
Snippets Groups Projects
Commit a6788d81 authored by Olivier PEREZ's avatar Olivier PEREZ
Browse files

Host can now force URL, used behind a reverse-proxy

parent 57722777
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ class Utils { ...@@ -28,7 +28,7 @@ class Utils {
$dirname = dirname($_SERVER['SCRIPT_NAME']); $dirname = dirname($_SERVER['SCRIPT_NAME']);
$dirname = $dirname === '\\' ? '/' : $dirname . '/'; $dirname = $dirname === '\\' ? '/' : $dirname . '/';
$dirname = str_replace('/admin', '', $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); return $scheme . '://' . preg_replace('#//+#', '/', $server_name);
} }
......
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) * 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 // Application name
const NOMAPPLICATION = '<Application name>'; const NOMAPPLICATION = '<Application name>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment