Skip to content

Instantly share code, notes, and snippets.

@ThijsFeryn
Created January 20, 2016 13:00
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 ThijsFeryn/6d5188923963ed50c71d to your computer and use it in GitHub Desktop.
Save ThijsFeryn/6d5188923963ed50c71d to your computer and use it in GitHub Desktop.
Print custom headers set by Varnish to display the different IP's and print the X-Forwarded-For header
<?php
echo "Client IP: " . $_SERVER["HTTP_X_CLIENTIP"]. "<br />".PHP_EOL;
echo "Server IP: " . $_SERVER["HTTP_X_SERVERIP"]. "<br />".PHP_EOL;
echo "Local IP: " . $_SERVER["HTTP_X_LOCALIP"]. "<br />".PHP_EOL;
echo "Remote IP: " . $_SERVER["HTTP_X_REMOTEIP"]. "<br />".PHP_EOL;
echo "X-Forwarded-For: " . $_SERVER["HTTP_X_FORWARDED_FOR"]. "<br />".PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment