The very nature of using the Nginx accelerator changes the remote address of clients connecting to your VPS.
We use the industry-standard
X-Forwarded-For HTTP header to convey the original IP address. With Apache, you just need to install mod_rpaf and configure it:
sudo apt-get install libapache2-mod-rpaf
To configure it, add the IP address of your Nginx accelerator to the
RPAFproxy_ips line in its config file at
/etc/apache2/mods-enabled/rpaf.conf. The IP of your Nginx accelerator is documented in your VPS setup email.