matomo-org / matomo-org/docker

Forward real ip in .examples/nginx

Open
#210 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
1k
Forks
384
PR merge metrics
No merged PRs in 30d

Description

The IP displayed is wrong, because nginx will not send it to php-fpm.
Add this to `.examples/nginx/matomo.conf` on line 24:

```nginx
fastcgi_param REMOTE_ADDR $http_x_real_ip;
```

---

**Side note:**

For the external nginx server (listening to 80/443), one can add:
```nginx
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open `.examples/nginx/matomo.conf` and inspect the FastCGI parameters around line 24. Update the example so PHP-FPM receives the real client IP, then verify the configuration remains valid and the displayed IP is correct when traffic arrives through the external nginx proxy.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx
Domain
devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.