Hi, I have two installations of 3.8.1, one a "manual" installation and the other with Docker (I'm migrating the first one's db to the second one). I can't login on either of them if using Google Chrome, while I have no problems with Firefox or Safari. I have tried uninstalling Chrome completely and even on another Mac I have the same issue. Whenever I enter my credentials I get the following error:
Error: Form security failed. Please reload the form and check that your cookies are enabled. If you use a proxy server, you must configure Matomo to accept the proxy header that forwards the Host header. Also, check that your Referrer header is sent correctly.
By doing a lot of searching, I have tried so many things but nothing has worked so far. I have tried several combinations of settings in config.ini.php concerning proxy but I wonder why in other browsers it just works. At the moment the settings in the config.ini.php are as follows:
[General]
salt = "..."
trusted_hosts[] = "analytics.domain.com"
assume_secure_protocol = 1
force_ssl = 1
proxy_client_headers[] = HTTP_CLIENT_IP
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_client_headers[] = HTTP_X_REAL_IP
proxy_host_headers[] = HTTP_X_FORWARDED_HOST
Matomo is behind Nginx in both installations and the proxy settings are as follows (e.g. for the Docker installation):
proxy_pass http://matomo;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
What can I do to be able to log in with Chrome?
Thanks in advance!
Please check if the cookies get correctly forwarded to the user.
Please check if the cookies get correctly forwarded to the user.
Hi, thanks for your reply. Any tips on how I would do that? Also why does it work in Firefox etc if it's an issue with the cookies? Thanks!
Browsers du handle cookies differently. You should be able to get this information from the browsers dev tools.
could you upgrade to the latest Matomo version? see https://matomo.org/docs/update/
if you still experience this issue afterwards, could you maybe create a phpinfo.php file with the content <?php phpinfo(); and post a link to this "phpinfo" page?
Hope we can troubleshoot this issue and find the root cause!
Hi @mattab, I am running 3.10.0 with Docker. I just upgraded to that version but I still have the same problem. Here it shows that the image has been updated 10 hours ago, so it should be the one you are referring to? I still have the cookies/proxy error. Thanks!
Check if you use http vs https maybe in another browser?
Check if you use http vs https maybe in another browser?
I am forcing https.
I have the same problem, how to solve it
hi ,i can login in chrome finally by adding the port after X-Forwarded-Host
this is my setting
nginx:
server {
listen YOUR_PORT;
server_name xxx-matomo;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:YOUR_PORT;
proxy_set_header X-Real-IP $remote_addr;
//matomo-base is kubernetes service name
proxy_pass http://matomo-base;
}
}
config.ini.php:
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_client_headers[] = "X-Real_IP"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
//matomo-base is kubernetes service name
proxy_ips[] = "http://matomo-base"
salt = "xxx"
enable_trusted_host_check=0
Awesome thanks
Most helpful comment
hi ,i can login in chrome finally by adding the port after X-Forwarded-Host
this is my setting
nginx:
server {
listen YOUR_PORT;
server_name xxx-matomo;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:YOUR_PORT;
proxy_set_header X-Real-IP $remote_addr;
//matomo-base is kubernetes service name
proxy_pass http://matomo-base;
}
}
config.ini.php:
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_client_headers[] = "X-Real_IP"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
//matomo-base is kubernetes service name
proxy_ips[] = "http://matomo-base"
salt = "xxx"
enable_trusted_host_check=0