I am also on Nginx and that did not help me. And this is a brand new problem on an upgrade to 4.0.3 from 3.14.1 and after running all database updates (and truncating the session table, after I observed the problem).
But Matomo uses this variable for a host check and if it doesn’t match
What is the check being done against? Is it a value in the database?
EDIT:
in the end I did:
- an update to the
piwik_option
table as the piwikUrl was set to an older domain (which we have been redirecting away with a 301 to a newer domain for a long time, as well as both domains being in the config.ini.php as trusted_hosts[]
entries, and this was never an issue til now to login with the newer domain)
- peppered my nginx vhost with
fastcgi_param SERVER_NAME $host;
both before and after the fastcgi_pass… maybe ordering mattered. My snippet was like this:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
The fastcgi_param SERVER_NAME
is also set in a file that is included via snippets/fastcgi-php.conf
so it was possibly overriding the setting I had set. I put the SERVER_NAME param both before and after to be sure.
So in the end, this indeed worked (the fastcgi_param SERVER_NAME
statement has to be the last case so it doesn’t get overridden, or if it suits your setup and doesn’t break other sites on the server that depend on the include file, then edit wherever it is already being set in the include
file…):
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SERVER_NAME $host;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
Truncating the session table was probably not necessary but was done for good measure…