Visitor Country Displayed as 'Unknown' #2942
-
Hi, I've deployed Umami on my server, and everything is working well except for one issue: all visitors are displayed as coming from 'unknown' countries. I read issue #814 and suspect that something might be wrong with my Nginx configuration. I tried adding the following configuration, but it didn't resolve the issue: 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;
} Here is my complete Nginx configuration: server {
listen 80;
server_name analytics.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name analytics.example.com;
ssl_certificate /etc/nginx/ssl/analytics.example.com/analytics.example.com.pem;
ssl_certificate_key /etc/nginx/ssl/analytics.example.com/analytics.example.com.key;
gzip on;
gzip_proxied any;
gzip_types application/javascript application/x-javascript text/css text/javascript;
gzip_comp_level 5;
gzip_buffers 16 8k;
gzip_min_length 256;
error_page 400 401 403 404 405 408 500 502 503 504 /502.html;
location = /502.html {
root /var/www/html;
internal;
}
location /_next/static/ {
alias /var/www/site-analytics/umami/.next/static/;
expires 365d;
access_log off;
}
location / {
proxy_pass http://127.0.0.1:3004;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
} Despite these settings, the issue persists. Is there anything I might be missing or misconfigured? Any ideas on how to fix this? Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The issue was resolved by modifying the Nginx config from |
Beta Was this translation helpful? Give feedback.
The issue was resolved by modifying the Nginx config from
/api/collect
to/api/send
and addingCLIENT_IP_HEADER=X-Real-IP
to the.env
file.