No tracking on server accessible through 1:1 NAT conversion

Hi there and thanks for an awesome tool!

I have been experimenting with it for some time on a Drupal 7 site installed on an Ubuntu 12.04 VPS (version 3.0.2 with MySQL 5.5.54 and PHP 5.5.37). It had been working correctly.

I migrated the entire site's database and files to an Ubuntu 16.04 VPS (version 3.0.2 with MySQL 5.7.17 and PHP 5.6.30).

The piwik module in Drupal has exactly the same settings but I get no tracking. I could also migrate the piwik database, but still no tracking.

Also, trying to check things at the Drupal Piwik module, I get validation errors for piwik.php, either in http or in https (my site is SSL-enabled with a personally signed key just for admin pages):

The validation of "" failed with error "Not Found" (HTTP code 404).
The validation of "" failed with error "Error opening socket ssl://" (HTTP code 0).

Any thoughts?

Thanks in advance!

EDIT: Apache's mod_secure module is not loaded. I also tried to replace "piwik.php" with "index.php" in /sites/all/modules/piwik/ as proposed in Still no solution.

EDIT 2: I switched to PHP 7.1 on the new server. Still no improvement

I did some further searches and tracked the problem down to the VPS setup.

The server is accessible through 1:1 NAT conversion and internally has a 172.x.x.x private IP address. The piwik installation is on the same server as the Drupal site. As soon as I included the internal IP address in Piwik’s Trusted Piwik Hostnames, the validation problems from the Drupal Piwik module were solved.

There is still no tracking and I am trying to resolve this.