Created
September 1, 2015 14:07
-
-
Save cgrymala/197e1e587bf49785b095 to your computer and use it in GitHub Desktop.
Attempt to fix the way CASMaestro/phpCAS on WPEngine sends the application URL to the CAS server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_PORT'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_PORT'] ) ) { | |
$ports = explode(',', $_SERVER['HTTP_X_FORWARDED_PORT']); | |
error_log( 'The forwarded Port var is set to: ' . $ports[0] ); | |
} else if ( isset( $_SERVER['SERVER_PORT'] ) && ! empty( $_SERVER['SERVER_PORT'] ) ) { | |
error_log( 'The server Port var is set to: ' . $_SERVER['SERVER_PORT'] ); | |
$_SERVER['SERVER_PORT'] = 443; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment