Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Last active December 12, 2016 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeardedGinger/a6c183f65d3e81cc2541797bc107e886 to your computer and use it in GitHub Desktop.
Save BeardedGinger/a6c183f65d3e81cc2541797bc107e886 to your computer and use it in GitHub Desktop.
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