Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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