nginx をリバース プロキシとして使用しています。
location /facebook/
{
proxy_pass http://upload #this is an nother server;
proxy_redirect off;
}
と私のコード:
$facebook = new Facebook(array(
'appId' => "xx",
'secret' => "xxxxxxxx",
));
$user = $facebook->getUser();
if ($user){
$user_profile = $facebook->api('/me');
var_dump($user_profile);
}
else
{
$url=$facebook->getLoginUrl( array( 'scope' => $req_perms) );
//if I used nginx I must change redirect_uri
$url = str_replace('http%3A%2F%2Fupload%2F', 'http%3A%2F%2F'. $mydomian .'%2F',$url);
header("Location:".$url);
}
nginx をリバース プロキシとして使用しない場合は正常に動作しますが、使用すると$facebook->getUser()
0 が返されるため無限ループが発生します。何が問題なのかわかりません。