Skip to content
Snippets Groups Projects
Commit 576fcf24 authored by Too Much IO's avatar Too Much IO Committed by Federico Dossena
Browse files

Add support for reverse proxys (#100)

parent 0b241aa9
No related branches found
No related tags found
No related merge requests found
<?php
header('Content-Type: text/plain; charset=utf-8');
echo $_SERVER['REMOTE_ADDR'];
header('Content-Type: text/plain; charset=utf-8');
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
echo $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['X-Real-IP'])) {
echo $_SERVER['X-Real-IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
echo $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
echo $_SERVER['REMOTE_ADDR'];
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment