The changes are all to the wp_cassify_get_current_url function in wp_cassify_utils.php. See the comments in the code:
public static function wp_cassify_get_current_url( $wp_cassify_default_wordpress_blog_http_port = 80, $wp_cassify_default_wordpress_blog_https_port = 443 ) {
$current_url = ( @$_SERVER[ 'HTTPS' ] == 'on' ) ? 'https://' : 'https://';
// If cassified application is hosted behind reverse proxy.
if ( isset( $_SERVER[ 'HTTP_X_FORWARDED_HOST' ] ) ) {
$current_url .= $_SERVER[ 'HTTP_X_FORWARDED_HOST' ];
} elseif (isset( $_ENV['PANTHEON_SITE'] )) { // Are we on Pantheon? Use HTTP_HOST
$current_url .= $_SERVER['HTTP_HOST'];
}
else {
$current_url .= $_SERVER[ 'SERVER_NAME' ];
}
if( ( $_SERVER[ 'SERVER_PORT' ] != $wp_cassify_default_wordpress_blog_http_port ) &&
( $_SERVER[ 'SERVER_PORT' ] != $wp_cassify_default_wordpress_blog_https_port ) &&
!isset( $_ENV['PANTHEON_SITE'] ) ) // Don't use the port if we're on Pantheon
{
$current_url .= ':' . $_SERVER[ 'SERVER_PORT' ];
}
// Specific use case configuration for WordPress hosted on nginx behind AWS loadbalancer.
if (
isset( $_SERVER[ 'HTTP_HOST' ] ) &&
isset( $_SERVER[ 'HTTP_X_FORWARDED_PORT' ] ) &&
isset( $_SERVER[ 'HTTP_X_FORWARDED_PROTO' ] ) ) {
$current_url = ( @$_SERVER[ 'HTTPS' ] == 'on' ? 'https://' : 'https://' ) . $_SERVER[ 'HTTP_HOST' ];
if( ( $_SERVER[ 'HTTP_X_FORWARDED_PORT' ] != $wp_cassify_default_wordpress_blog_http_port ) &&
( $_SERVER[ 'HTTP_X_FORWARDED_PORT' ] != $wp_cassify_default_wordpress_blog_https_port ) ) {
$current_url .= ':' . $_SERVER[ 'SERVER_PORT' ];
}
if ( $_SERVER[ 'HTTP_X_FORWARDED_PROTO' ] == 'https' ) {
$current_url = str_replace( "http:", "https:", $current_url );
}
}
$current_url .= $_SERVER[ 'REQUEST_URI' ];
return $current_url;
}