Quantcast
Channel: omnioo lab. record » PHP/MySQL
Viewing all articles
Browse latest Browse all 59

X-Cluster-Client-Ipをphpで取得

$
0
0

http://www.omnioo.com/record/ubuntudebian/lb_x-cluster-client-ip/
で書いたようにApacheでは環境変数のX-Cluster-Client-IpからNAT前のグローバルIPを取得できるのですが、PHPからはレスポンスヘッダーから取得しないとダメという話です。

<?php
$headers = getallheaders();
print $headers['X-Cluster-Client-Ip'];

//var_dump(getallheaders());

Viewing all articles
Browse latest Browse all 59

Trending Articles