This patch enables modx revo to run on an arbitrary port (aka port-based vhosts) behind a loadbalancer. Explanation: internet <--> haproxy 80/tcp <--> port-based website 8082/tcp What this patch basically does it to convince modx port 8082 is the default web server port thus no port information is appended to (dynamic) links. Copyright 2011 Rafał Frühling --- setup/index.php~ 2012-12-03 09:18:10.000000000 +0100 +++ setup/index.php 2013-03-29 11:01:50.000000000 +0100 @@ -69,8 +69,8 @@ $https = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false; $installBaseUrl= (!$https || strtolower($https) != 'on') ? 'http://' : 'https://'; $installBaseUrl .= $_SERVER['HTTP_HOST']; - if ($_SERVER['SERVER_PORT'] != 80) $installBaseUrl= str_replace(':' . $_SERVER['SERVER_PORT'], '', $installBaseUrl); - $installBaseUrl .= ($_SERVER['SERVER_PORT'] == 80 || ($https !== false || strtolower($https) == 'on')) ? '' : ':' . $_SERVER['SERVER_PORT']; + if ($_SERVER['SERVER_PORT'] != 8082) $installBaseUrl= str_replace(':' . $_SERVER['SERVER_PORT'], '', $installBaseUrl); + $installBaseUrl .= ($_SERVER['SERVER_PORT'] == 8082 || ($https !== false || strtolower($https) == 'on')) ? '' : ':' . $_SERVER['SERVER_PORT']; $installBaseUrl .= $_SERVER['PHP_SELF']; define('MODX_SETUP_URL', $installBaseUrl); } else {