question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Country data NOT collecting properly

See original GitHub issue

Issue

Umami does not correctly record the country of visitors. All visitors are recorded as being from Germany, even though I am visiting the site from Australia.

The server on which umami runs is located in Germany, however if you look at the HTTP headers you will see no German IP address is mentioned. Also the Docker container is unaware it is located in Germany as the NGINX reverse proxy making the request to it and the LXC container in which it is nested both have a 10.109.0.0 (private) IP address.

Environment

  • Umami v1.22.0
  • Running in an LXC nested Docker container
  • External shared MariaDB database
  • Behind an NGINX reverse proxy with following relevant settings:
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-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Forwarded "$proxy_add_forwarded;by=$server_addr;host=$host;proto=https;"; #RFC7239

Screenshots

umami_screenshot

Debug data

See umami_test_headers.txt for all HTTP headers. Please note, this was created on a separate LXC container behind the same NGINX reverse proxy with an identical configuration

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
ajnisbetcommented, Oct 8, 2021

I’m having the same issue. All visitors appear to come from the country in which the nginx proxy is located.

I’m using these settings:

location = /api/collect {
            proxy_pass https://analytics.example.com/api/collect;
            proxy_buffering on;
            proxy_http_version 1.1;
            proxy_ssl_session_reuse off;
            proxy_ssl_server_name on;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Host  $host;
        }
0reactions
907739769commented, Oct 11, 2022

I’m having the same issue. All visitors appear to come from the country in which the nginx proxy is located.

I’m using these settings:

location = /api/collect {
            proxy_pass https://analytics.example.com/api/collect;
            proxy_buffering on;
            proxy_http_version 1.1;
            proxy_ssl_session_reuse off;
            proxy_ssl_server_name on;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Host  $host;
        }

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Data Revolution in Developing Countries Has a Long ...
Even when data are successfully collected and utilized, two major pitfalls await. The first is the potential for politicization of the data.
Read more >
No Data—No Progress: Country Findings
If so, have governments collected disaggregated data to assess progress? Have governments made the necessary changes in their practices to ensure that this...
Read more >
Why are some data not available?
Some countries do not regularly report data due to conflict, lack of statistical capacity, or other reasons (e.g. Somalia, North Korea, and some...
Read more >
Data Residency Laws by Country: an Overview
The rules of localisation apply to companies only if they carry out specific actions intentionally: collecting, recording, systematisation, ...
Read more >
Data collection challenges and improvements
Organisations may face a number of challenges in collecting consistent and quality data. To develop methods to improve data collection ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found