How to fix Jetpack if using NGINX as a proxy

Add “set_real_ip_from;” on the backend, to the nginx.conf file. Under http. Replace the IP with the proxy’s IP. Stolen from here.
Editing wp-config.php with their hack, didn’t work for whatever reason.

if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
  $forwarded_ips = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
  $_SERVER['REMOTE_ADDR'] = $forwarded_ips[0];
  unset( $forwarded_ips );

You can try that if you can’t change your web server’s config.
Just realized, fastcgi might of cached it. So purging the cache, could of made the wp-config.php hack work. I also tried changing it to the X-Real-IP header.