matomo-org / matomo-org/docker

matomo.js script failing to load

Open
#202 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Shell
Stars
1k
Forks
384
PR merge metrics
No merged PRs in 30d

Description

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 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;
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The report points to .example/nginx, config.ini.php, and the /matomo.js and /matomo.php entry points. Reproduce tracker requests through the Nginx reverse proxy and compare them with direct access; done means JavaScript tracking records visits in the dashboard through this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, javascript, nginx, ubuntu
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.