Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Last active December 12, 2016 21:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Reverse Proxy Conditional
<?php
/**
* Conditional to check if we're being served via the Reverse Proxy.
* The URL for the Forwarded Server below (example.com) should be the final
* URL for the site using the Reverse Proxy.
*/
function lc_is_reverse_proxy() {
if ( 'www.example.com' === $_SERVER['HTTP_X_FORWARDED_SERVER'] ) {
return true;
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment