Hi Matomo team,
I'm encountering an InvalidNonceReferrererror because this core/Nonce.php#L126 if statement returned false due to core/Url.php#L621 can't access $_SERVER['SCRIPT_URI'].
After some research, I learned that SCRIPT_URI needs to be explicitly passed from the web server configuration. However, I noticed that:
- The current matomo.conf doesn't set this parameter
- It's also missing from the included fastcgi-php.conf
I resolved the issue by adding the following to my matomo.conf:
location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs).php {
...
# other fastcgi_params
fastcgi_param SCRIPT_URI $scheme://$http_host$request_uri; # <-- this line
fastcgi_pass php-handler;
...
}
Would this be the correct fix? If so, I'd be happy to submit a pull request with this change in the coming days.
Thanks for your time and for maintaining Matomo!
Hi Matomo team,
I'm encountering an
InvalidNonceReferrererrorbecause this core/Nonce.php#L126 if statement returned false due to core/Url.php#L621 can't access$_SERVER['SCRIPT_URI'].After some research, I learned that
SCRIPT_URIneeds to be explicitly passed from the web server configuration. However, I noticed that:I resolved the issue by adding the following to my matomo.conf:
Would this be the correct fix? If so, I'd be happy to submit a pull request with this change in the coming days.
Thanks for your time and for maintaining Matomo!