Hope y’all are doing well,
I have a problem.
I have 3 images.
1- Matomo:5.2.0
2- MariaDB:latest
3- Nginx:latest
This is the docker-compose:
services:
matomoDb:
image: mariadb:latest
command: --max-allowed-packet=64MB
restart: always
ports:
- "3306:3306"
volumes:
- matomoDb:/var/lib/mysql:Z
env_file:
- db.env
networks:
- custom_network
matomo:
build:
context: .
dockerfile: Dockerfile
image: matomo-geoip:latest
restart: always
links:
- matomoDb
volumes:
- matomo:/var/www/html:z
networks:
- custom_network
matomoWeb:
image: nginx:latest
restart: always
volumes:
- matomo:/var/www/html:z,ro
- ./default.conf:/etc/nginx/conf.d/default.conf:z
ports:
- "8082:80"
networks:
- custom_network # Custom network for communication with other services
volumes:
matomoDb:
matomo:
networks:
custom_network:
driver: bridge
This is default.conf
upstream backend {
server matomo:9000; # Ensure the port is specified here
}
server {
listen 80;
root /var/www/html/;
index index.php index.html index.htm;
# Forward the real client IP and other necessary headers
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass backend;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Forward client IP and real IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
After I set matomo up in the admin page, I go to
Settings → System → Geolocation, then I download the GeoIP 2 database.
and then I choose the
DBIP - GeoIp 2 (php) and save
I get the wrong IP address being resolved by GeoIP. The IP i get is docker Docker IP address.
How do I fix this, please?
Thank you all.