Update config.php
This commit is contained in:
+6
-1
@@ -386,7 +386,12 @@ define('APP_NAME', 'WhatsApp Bot System');
|
||||
define('APP_VERSION', '2.0.0');
|
||||
// URL auto-detectada según protocolo y host actuales
|
||||
if (!defined('APP_URL')) {
|
||||
$__proto = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
// Detectar HTTPS correctamente detrás de proxy reverso (Coolify, nginx, etc.)
|
||||
$__isHttps = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
||||
|| ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https'
|
||||
|| ($_SERVER['HTTP_X_FORWARDED_SSL'] ?? '') === 'on'
|
||||
|| ($_SERVER['HTTP_FRONT_END_HTTPS'] ?? '') === 'on';
|
||||
$__proto = $__isHttps ? 'https' : 'http';
|
||||
$__host = $_SERVER['HTTP_HOST'] ?? 'localhost';
|
||||
define('APP_URL', $__proto . '://' . $__host);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user