matomo.js script failing to load
Mick00 opened this issue · 3 comments
Hi,
I was trying to install matomo on a local server to test it, but I can't make the le javascript tracker work. The install was successful and I can access the dashbord.
My current set up is a Nginx instance as reverse proxy on an ubuntu 20 machine. This nginx instance pass the connections to a docker-compose instance like the one in .example/nginx.
Visits are recorded correctly when I go to the mamoto.php page and I can see them in my dashboard. It also work using the noscript tracker (I removed the tags and placed the in my page.).
On Firefox the following error in console: Loading failed for the <script> with source “http://my.domain.com/matomo.js” (I am using http for testing as I'm on a local network). I can fetch the mamoto.js script successfully by going to http://my.domain.com/matomo.js. From Microsoft Edge, I do not see any error in the console, but I still don't see visits in the dashboard.
I added the following lines to my config.ini.php under [general]:
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_host_headers[] = HTTP_X_FORWARDED_HOST
My proxy conf for the reverse proxy is the followin:
server {
server_name matomo.my.domain.com;
listen [::]:80 ipv6only=on;
listen 80;
location / {
proxy_pass http://localhost:8081;
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;
}
}
4 years on and I have the exact same issue, same browser: firefox
Though I am on linux, no edge browser.
I can browse to http://my.domain.com/matomo.js and the file loads into the browser, but when I access my site I get Loading failed for the <script> with source “https://analytics.bevansbench.com/matomo.js”.
in the console, and no visits show up in matomo