My localhost website is working perfectly using Facebook SDKV4 on Apache. But after migration to Nginx PHP-FPM I cannot login anymore. All Facebook app config is the same nothing is change except for my local server.
I'm new to nginx I searched a lot and did not found anything about what I'm missing.
Here's my Nginx Site Config:
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name localhost;
root /webroot/site/public_html;
index index.php index.html index.htm default.html default.htm;
access_log /webroot/site/app/logs/access.log;
error_log /webroot/site/app/logs/error.log;
location / {
try_files $uri $uri/ /index.php?q=$uri;
}
location ~ \.php$ {
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
I think it has something to do with the session. Does anyone experience this problem before? any clue will help.
My System: php-fpm 5.6, nginx-1.9.2 installed using homebrew
It seems that my problem is related to this question Sessions are Missing With Facebook PHP Sdk (Nginx Php-Fpm)
I cannot reply to that question.
Update: It turns out that csrf_token is not created on session using my nginx php-fpm 5.6 local server. I tried using my apache (XAMPP) server csrf_token is created and able to login. I still don't know whats wrong with my configuration. any clue will help.