If you have a domain on Cloudflare with Flexibile SSL, then it might need to setup https transparently into your Nginx like this:
fastcgi_param HTTPS on; fastcgi_param SERVER_PORT 443; fastcgi_param REQUEST_SCHEME https; fastcgi_param HTTP_X_FORWARDED_PROTO https;
This way, PHP will “swear” that it is running on https 🙂
Many thanks for the sharing.