Comments (23)
The last time I tried cf workers, everything was working as expected: #2137 (comment)
Could you please share more of your setup?
from analytics.
Hi @ruslandoga
All statistics are displayed correctly, except the Map with the country / region / city of the visitors. It does not show anything.
When I deactivate the Worker, everything works perfectly.
I have Plausible with Nginx Proxy Manager (without additional HTTP headers.
I have the Plausible domain as "Proxied".
I have tried with Plausible remote:
iex> Plausible.Geo.lookup("1.1.1.1.1")
And it shows the country and everything ok.
The problem is that it is not reflected in the UI.
from analytics.
Would you be able to share your configuration files, including nginx, worker scripts, and anything else that seems relevant?
from analytics.
You can also trace the incoming request to see what headers are included with recon_trace. There have been several discussions where it helped resolve IP geo location issues. #3248 (comment) #2767 (reply in thread) etc. (you can search for others using parts of that code snippet)
from analytics.
I have executed this inside Plausible remote. But I don't know how to check it with my domain. Sorry.
iex> headers = fn {:trace, _pid, :call, {_mod, _fun, [%Plug.Conn{req_headers: headers}]}} -> inspect(headers) end
iex> mod_fun_args = {PlausibleWeb.RemoteIp, :get, 1}
iex> how_many_times = 5
iex> :recon_trace.calls(mod_fun_args, how_many_times, formatter: headers)
My Worker Script is the same of yours (changing only my domain).
My Nginx conf for the Plausible domain:
# ------------------------------------------------------------
# stats.xxxxx.com
# ------------------------------------------------------------
server {
set $forward_scheme http;
set $server "192.168.10.165";
set $port 3998;
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name xxxxx.com;
# Let's Encrypt SSL
include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-23/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-23/privkey.pem;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
access_log /data/logs/proxy-host-15_access.log proxy;
error_log /data/logs/proxy-host-15_error.log warn;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
from analytics.
I execute Plausible GeoIP command with this IP, but in the UI not appear... with Workers enabled.
![Captura de pantalla 2024-04-04 a las 23 18 26](https://private-user-images.githubusercontent.com/64467637/319776831-29e19e5a-7181-4087-82bd-c7247f5c29fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYzMzUxMzEsIm5iZiI6MTcxNjMzNDgzMSwicGF0aCI6Ii82NDQ2NzYzNy8zMTk3NzY4MzEtMjllMTllNWEtNzE4MS00MDg3LTgyYmQtYzcyNDdmNWMyOWZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDIzNDAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiNjFlNWQ0MGUyZmMzNGI4MjFhMmE5NDI4MmQ4OWZiODE0Y2JkYmU3YWNiNTRkNWE4ZGJjMzEzZDZkZDExOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5u5nPWGoM6YTwLtXMnkE3Fd3OlbKxbksZ9uRA4BTJ54)
![Captura de pantalla 2024-04-04 a las 23 18 34](https://private-user-images.githubusercontent.com/64467637/319776792-ea4b5c69-f53a-494a-b930-84d8139db40c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYzMzUxMzEsIm5iZiI6MTcxNjMzNDgzMSwicGF0aCI6Ii82NDQ2NzYzNy8zMTk3NzY3OTItZWE0YjVjNjktZjUzYS00OTRhLWI5MzAtODRkODEzOWRiNDBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDIzNDAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAyY2NmNzQzMjkyYzU1ZTUwODA1M2I3Mjg5NjUyYTEwZTc3MWRhY2RkZDJkOGUwYjY4MTRkY2FkODY3ZmI5MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aUydjvv-dDuBBQy2yqWV5--EYpFY3hFBMVh352BA2GA)
from analytics.
Ant the output for this command (in case it helps.)
![Captura de pantalla 2024-04-04 a las 23 20 27](https://private-user-images.githubusercontent.com/64467637/319777177-6a91581a-7eef-4d8b-8887-12ff7133ee58.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYzMzUxMzEsIm5iZiI6MTcxNjMzNDgzMSwicGF0aCI6Ii82NDQ2NzYzNy8zMTk3NzcxNzctNmE5MTU4MWEtN2VlZi00ZDhiLTg4ODctMTJmZjcxMzNlZTU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDIzNDAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4ZDhiZDMzODA3MmNmMGNkOTMzYmVlM2Y1YzA3MDUwM2RjMDI1NjYxNWFhNzhiMTAwZDA2MjgzNjE1OTlmMmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KnznGICwtzSjsYcwuCWr5YgQ53vup0imAgtzvTd6giQ)
from analytics.
I have executed this inside Plausible remote. But I don't know how to check it with my domain. Sorry.
You would need to visit your site which would make an /api/event
call. The traces would be printed in the console. Ideally, you'd run it both when the Worker is activated and when it's not.
from analytics.
All statistics are displayed correctly, except the Map with the country / region / city of the visitors. It does not show anything.
When I deactivate the Worker, everything works perfectly.
I've re-read this now, and it's not clear what exactly is wrong, is the map empty or not displayed at all? Can you show screenshot for when the Worker is activated and when it's not?
from analytics.
If I access with an IP from Portugal:
With Worker
Without Worker
![Captura de pantalla 2024-04-05 a las 11 37 17](https://private-user-images.githubusercontent.com/64467637/319939087-ce95ab7c-8cc0-4aec-ae81-796b07a0a3cc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYzMzUxMzEsIm5iZiI6MTcxNjMzNDgzMSwicGF0aCI6Ii82NDQ2NzYzNy8zMTk5MzkwODctY2U5NWFiN2MtOGNjMC00YWVjLWFlODEtNzk2YjA3YTBhM2NjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDIzNDAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE3ZDM4OTNmZGU3NWI4YzM4MjQ1N2ZmYzhlYTJhMjdhMTM0ZDIxOGQ2ZTA3MTRlNzA0Zjg5YjlmMDkyM2NkYTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yu81W5Kpj_bp2A1kpZMLIJOnw1ms4qFJcoBWF1gYC-Q)
The map is not updated. The rest of the statistics work OK. If it was a /api/event problem, I think it would not show any statistics.
from analytics.
Great, then #3976 (comment) should help resolve it. Most likely, the X-Forwarded-For header or similar is dropped somewhere along the way. You can also trace Plausible.Geo.lookup
to see what exact IP address is used for the lookup of your Portugal request and what info it gets in return.
from analytics.
Great, then #3976 (comment) should help resolve it. Most likely, the X-Forwarded-For header or similar is dropped somewhere along the way. You can also trace
Plausible.Geo.lookup
to see what exact IP address is used for the lookup of your Portugal request and what info it gets in return.
Thanks for your help.
Forgive my clumsiness. I have executed this, but then I don't know how to continue.
iex> headers = fn {:trace, _pid, :call, {_mod, _fun, [%Plug.Conn{req_headers: headers}]}} -> inspect(headers) end
iex> mod_fun_args = {PlausibleWeb.RemoteIp, :get, 1}
iex> how_many_times = 5
iex> :recon_trace.calls(mod_fun_args, how_many_times, formatter: headers)
from analytics.
I have executed this, but then I don't know how to continue.
You would need to visit https://hdsplus.co after you run these commands. The traces would be printed in the console. Ideally, you'd run it both when the Worker is activated and when it's not.
You can check the previous discussions I linked for more info :) E.g. #2767 (reply in thread)
from analytics.
Sorry, on which console do I view the trace? The Plausible console does not show anything new.
- I execute these commands
- I access to my Web with Chrome and Safari
![Captura de pantalla 2024-04-05 a las 12 04 43](https://private-user-images.githubusercontent.com/64467637/319951516-c84b9b5e-d3b9-45e6-95c3-146579aabf63.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYzMzUxMzEsIm5iZiI6MTcxNjMzNDgzMSwicGF0aCI6Ii82NDQ2NzYzNy8zMTk5NTE1MTYtYzg0YjliNWUtZDNiOS00NWU2LTk1YzMtMTQ2NTc5YWFiZjYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDIzNDAzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhNjZkYWY5ZGExNzcyM2JiZTg5NDNlNDA3NmJkNmVhMDJjNjAyOThjZmQwNWEwNWViMjAxMDJkMzEwMjQ1YWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DEFrmzLAyYQUui8wWp588GUGm83BRFhYOI0ZopvuqWs)
from analytics.
If it doesn't show anything, then there are no requests reaching Plausible. Try running it with the Worker deactivated.
from analytics.
Neither... The Plausible remote console does not show anything new after executing these commands.
And without Worker everything works fine. Strange.
from analytics.
Ok, I see. I guess you are on v2.1.0-rc.0? The module name changed from RemoteIp
to RemoteIP
in #3761. Please run this command instead :recon_trace.calls({PlausibleWeb.RemoteIP, :get, 1}, 10)
from analytics.
Thanks! now yes!
from analytics.
Please post the traces as code or text snippet. It would be easier to debug.
from analytics.
With Worker OFF
10:51:03.834035 <0.10238.0> 'Elixir.PlausibleWeb.RemoteIP':get(#{owner=><0.10238.0>, port=>80, private=>#{'Elixir.PlausibleWeb.Router'=>[], phoenix_view=>#{'_'=>'Elixir.PlausibleWeb.Api.ExternalView'}, plug_session_fetch=>done, plug_session=>#{}, before_send=>[#Fun<Elixir.Plug.Session.0.76384852>,#Fun<Elixir.Plug.Telemetry.0.54455629>], phoenix_endpoint=>'Elixir.PlausibleWeb.Endpoint', phoenix_action=>event, phoenix_layout=>#{'_'=>{'Elixir.PlausibleWeb.LayoutView',app}}, phoenix_controller=>'Elixir.PlausibleWeb.Api.ExternalController', phoenix_format=><<"json">>, phoenix_router=>'Elixir.PlausibleWeb.Router'}, scheme=>http, status=>nil, script_name=>[], state=>unset, host=><<"stats.hdsplus.co">>, cookies=>#{}, params=>#{}, '__struct__'=>'Elixir.Plug.Conn', halted=>false, assigns=>#{}, method=><<"POST">>, adapter=>{'Elixir.Plug.Cowboy.Conn',#{pid => <0.10237.0>,port => 80,
scheme => <<"http">>,version => 'HTTP/1.1',
path => <<"/api/event">>,
host => <<"stats.hdsplus.co">>,
peer => {{192,168,144,1},59938},
sock => {{192,168,144,2},8000},
bindings => #{},
ref => 'Elixir.PlausibleWeb.Endpoint.HTTP',
cert => undefined,
headers =>
#{<<"accept">> => <<"*/*">>,
<<"accept-encoding">> => <<"gzip, br">>,
<<"accept-language">> =>
<<"es-ES,es;q=0.9,en;q=0.8,ca;q=0.7,zh-CN;q=0.6,zh;q=0.5">>,
<<"cdn-loop">> => <<"cloudflare">>,
<<"cf-ipcontinent">> => <<"EU">>,
<<"cf-ipcountry">> => <<"ES">>,
<<"cf-iplatitude">> => <<"41.39490">>,
<<"cf-iplongitude">> => <<"2.17560">>,
<<"cf-ray">> => <<"86f8fb147d571511-MAD">>,
<<"cf-region">> => <<"Catalonia">>,
<<"cf-region-code">> => <<"CT">>,
<<"cf-timezone">> => <<"Europe/Madrid">>,
<<"cf-visitor">> =>
<<"{\"scheme\":\"https\"}">>,
<<"content-length">> => <<"74">>,
<<"content-type">> => <<"text/plain">>,
<<"host">> => <<"stats.hdsplus.co">>,
<<"origin">> => <<"https://hdsplus.co">>,
<<"priority">> => <<"u=1, i">>,
<<"referer">> => <<"https://hdsplus.co/">>,
<<"sec-ch-ua">> =>
<<"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\"">>,
<<"sec-ch-ua-mobile">> => <<"?0">>,
<<"sec-ch-ua-platform">> => <<"\"macOS\"">>,
<<"sec-fetch-dest">> => <<"empty">>,
<<"sec-fetch-mode">> => <<"cors">>,
<<"sec-fetch-site">> => <<"same-site">>,
<<"user-agent">> =>
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36">>,
<<"x-forwarded-for">> =>
<<"83.44.134.248, 188.114.111.124">>,
<<"x-forwarded-proto">> => <<"https">>,
<<"x-forwarded-scheme">> => <<"https">>,
<<"x-real-ip">> => <<"188.114.111.124">>},
method => <<"POST">>,qs => <<>>,
path_info => undefined,streamid => 1,
body_length => 74,has_body => true,
host_info => undefined}}, secret_key_base=><<"jMI5V6xYzyfwHSHhYnluvqHKa69CdX7XOyKeh925wAOrpaq7yaZLQEovqh2mJJrbnuXSGZ0k0rHY0VxaQ4Q//w==">>, body_params=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', aspect=>body_params}, path_info=>[<<"api">>,<<"event">>], path_params=>#{}, query_params=>#{}, query_string=><<>>, remote_ip=>{192,168,144,1}, req_cookies=>#{}, req_headers=>[{<<"accept">>,<<"*/*">>},
{<<"accept-encoding">>,<<"gzip, br">>},
{<<"accept-language">>,
<<"es-ES,es;q=0.9,en;q=0.8,ca;q=0.7,zh-CN;q=0.6,zh;q=0.5">>},
{<<"cdn-loop">>,<<"cloudflare">>},
{<<"cf-ipcontinent">>,<<"EU">>},
{<<"cf-ipcountry">>,<<"ES">>},
{<<"cf-iplatitude">>,<<"41.39490">>},
{<<"cf-iplongitude">>,<<"2.17560">>},
{<<"cf-ray">>,<<"86f8fb147d571511-MAD">>},
{<<"cf-region">>,<<"Catalonia">>},
{<<"cf-region-code">>,<<"CT">>},
{<<"cf-timezone">>,<<"Europe/Madrid">>},
{<<"cf-visitor">>,<<"{\"scheme\":\"https\"}">>},
{<<"content-length">>,<<"74">>},
{<<"content-type">>,<<"text/plain">>},
{<<"host">>,<<"stats.hdsplus.co">>},
{<<"origin">>,<<"https://hdsplus.co">>},
{<<"priority">>,<<"u=1, i">>},
{<<"referer">>,<<"https://hdsplus.co/">>},
{<<"sec-ch-ua">>,
<<"\"Google Chrome\";v=\"123\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"123\"">>},
{<<"sec-ch-ua-mobile">>,<<"?0">>},
{<<"sec-ch-ua-platform">>,<<"\"macOS\"">>},
{<<"sec-fetch-dest">>,<<"empty">>},
{<<"sec-fetch-mode">>,<<"cors">>},
{<<"sec-fetch-site">>,<<"same-site">>},
{<<"user-agent">>,
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36">>},
{<<"x-forwarded-for">>,<<"83.44.134.248, 188.114.111.124">>},
{<<"x-forwarded-proto">>,<<"https">>},
{<<"x-forwarded-scheme">>,<<"https">>},
{<<"x-real-ip">>,<<"188.114.111.124">>}], request_path=><<"/api/event">>, resp_body=>nil, resp_cookies=>#{}, resp_headers=>[{<<"cache-control">>,<<"max-age=0, private, must-revalidate">>},
{<<"x-request-id">>,<<"F8NcwC-h5A2dSpEAAOWC">>},
{<<"access-control-allow-credentials">>,<<"true">>},
{<<"access-control-allow-origin">>,<<"*">>},
{<<"access-control-expose-headers">>,<<>>}]})
With Worker ON
10:49:58.276958 <0.10200.0> 'Elixir.PlausibleWeb.RemoteIP':get(#{owner=><0.10200.0>, port=>80, private=>#{'Elixir.PlausibleWeb.Router'=>[], phoenix_view=>#{'_'=>'Elixir.PlausibleWeb.Api.ExternalView'}, plug_session_fetch=>done, plug_session=>#{}, before_send=>[#Fun<Elixir.Plug.Session.0.76384852>,#Fun<Elixir.Plug.Telemetry.0.54455629>], phoenix_endpoint=>'Elixir.PlausibleWeb.Endpoint', phoenix_action=>event, phoenix_layout=>#{'_'=>{'Elixir.PlausibleWeb.LayoutView',app}}, phoenix_controller=>'Elixir.PlausibleWeb.Api.ExternalController', phoenix_format=><<"json">>, phoenix_router=>'Elixir.PlausibleWeb.Router'}, scheme=>http, status=>nil, script_name=>[], state=>unset, host=><<"stats.hdsplus.co">>, cookies=>#{}, params=>#{}, '__struct__'=>'Elixir.Plug.Conn', halted=>false, assigns=>#{}, method=><<"POST">>, adapter=>{'Elixir.Plug.Cowboy.Conn',#{pid => <0.10199.0>,port => 80,
scheme => <<"http">>,version => 'HTTP/1.1',
path => <<"/api/event">>,
host => <<"stats.hdsplus.co">>,
peer => {{192,168,144,1},54410},
sock => {{192,168,144,2},8000},
bindings => #{},
ref => 'Elixir.PlausibleWeb.Endpoint.HTTP',
cert => undefined,
headers =>
#{<<"accept">> => <<"*/*">>,
<<"accept-encoding">> => <<"gzip">>,
<<"accept-language">> =>
<<"es-ES,es;q=0.9">>,
<<"cdn-loop">> =>
<<"cloudflare; subreqs=1">>,
<<"cf-ew-via">> => <<"15">>,
<<"cf-ipcity">> => <<"El Astillero">>,
<<"cf-ipcontinent">> => <<"EU">>,
<<"cf-ipcountry">> => <<"ES">>,
<<"cf-iplatitude">> => <<"43.40160">>,
<<"cf-iplongitude">> => <<"-3.81530">>,
<<"cf-postal-code">> => <<"39610">>,
<<"cf-ray">> => <<"86f8f97ad3bb69eb-MAD">>,
<<"cf-region">> => <<"Cantabria">>,
<<"cf-region-code">> => <<"CB">>,
<<"cf-timezone">> => <<"Europe/Madrid">>,
<<"cf-visitor">> =>
<<"{\"scheme\":\"https\"}">>,
<<"cf-worker">> =>
<<"hdsplus.workers.dev">>,
<<"content-length">> => <<"125">>,
<<"content-type">> => <<"text/plain">>,
<<"host">> => <<"stats.hdsplus.co">>,
<<"origin">> => <<"https://hdsplus.co">>,
<<"priority">> => <<"u=3, i">>,
<<"referer">> => <<"https://hdsplus.co/">>,
<<"sec-fetch-dest">> => <<"empty">>,
<<"sec-fetch-mode">> => <<"cors">>,
<<"sec-fetch-site">> => <<"cross-site">>,
<<"user-agent">> =>
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15">>,
<<"x-forwarded-for">> =>
<<"2a06:98c0:3600::103, 172.70.57.158">>,
<<"x-forwarded-proto">> => <<"https">>,
<<"x-forwarded-scheme">> => <<"https">>,
<<"x-real-ip">> => <<"172.70.57.158">>},
method => <<"POST">>,qs => <<>>,
path_info => undefined,streamid => 1,
body_length => 125,has_body => true,
host_info => undefined}}, secret_key_base=><<"jMI5V6xYzyfwHSHhYnluvqHKa69CdX7XOyKeh925wAOrpaq7yaZLQEovqh2mJJrbnuXSGZ0k0rHY0VxaQ4Q//w==">>, body_params=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', aspect=>body_params}, path_info=>[<<"api">>,<<"event">>], path_params=>#{}, query_params=>#{}, query_string=><<>>, remote_ip=>{192,168,144,1}, req_cookies=>#{}, req_headers=>[{<<"accept">>,<<"*/*">>},
{<<"accept-encoding">>,<<"gzip">>},
{<<"accept-language">>,<<"es-ES,es;q=0.9">>},
{<<"cdn-loop">>,<<"cloudflare; subreqs=1">>},
{<<"cf-ew-via">>,<<"15">>},
{<<"cf-ipcity">>,<<"El Astillero">>},
{<<"cf-ipcontinent">>,<<"EU">>},
{<<"cf-ipcountry">>,<<"ES">>},
{<<"cf-iplatitude">>,<<"43.40160">>},
{<<"cf-iplongitude">>,<<"-3.81530">>},
{<<"cf-postal-code">>,<<"39610">>},
{<<"cf-ray">>,<<"86f8f97ad3bb69eb-MAD">>},
{<<"cf-region">>,<<"Cantabria">>},
{<<"cf-region-code">>,<<"CB">>},
{<<"cf-timezone">>,<<"Europe/Madrid">>},
{<<"cf-visitor">>,<<"{\"scheme\":\"https\"}">>},
{<<"cf-worker">>,<<"hdsplus.workers.dev">>},
{<<"content-length">>,<<"125">>},
{<<"content-type">>,<<"text/plain">>},
{<<"host">>,<<"stats.hdsplus.co">>},
{<<"origin">>,<<"https://hdsplus.co">>},
{<<"priority">>,<<"u=3, i">>},
{<<"referer">>,<<"https://hdsplus.co/">>},
{<<"sec-fetch-dest">>,<<"empty">>},
{<<"sec-fetch-mode">>,<<"cors">>},
{<<"sec-fetch-site">>,<<"cross-site">>},
{<<"user-agent">>,
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15">>},
{<<"x-forwarded-for">>,<<"2a06:98c0:3600::103, 172.70.57.158">>},
{<<"x-forwarded-proto">>,<<"https">>},
{<<"x-forwarded-scheme">>,<<"https">>},
{<<"x-real-ip">>,<<"172.70.57.158">>}], request_path=><<"/api/event">>, resp_body=>nil, resp_cookies=>#{}, resp_headers=>[{<<"cache-control">>,<<"max-age=0, private, must-revalidate">>},
{<<"x-request-id">>,<<"F8NcsOwkU1YbXDIAAbSB">>},
{<<"access-control-allow-credentials">>,<<"true">>},
{<<"access-control-allow-origin">>,<<"*">>},
{<<"access-control-expose-headers">>,<<>>}]})
from analytics.
x-forwarded-for
are completely different. Are both of these your own requests or real users? Either way, Plausible is picking the first IP address in the x-forwarded-for
list, which is different from x-real-ip
(whatever it is) which is the last element in the x-forwarded-for
list. According to https://en.wikipedia.org/wiki/X-Forwarded-For, the client IP address is the first element in the list, so Plausible is correct, at least according to Wikipedia.
from analytics.
Yes.
I tried again:
WORKER OFF
11:4:44.229315 <0.10633.0> 'Elixir.PlausibleWeb.RemoteIP':get(#{owner=><0.10633.0>, port=>80, private=>#{'Elixir.PlausibleWeb.Router'=>[], phoenix_view=>#{'_'=>'Elixir.PlausibleWeb.Api.ExternalView'}, plug_session_fetch=>done, plug_session=>#{}, before_send=>[#Fun<Elixir.Plug.Session.0.76384852>,#Fun<Elixir.Plug.Telemetry.0.54455629>], phoenix_endpoint=>'Elixir.PlausibleWeb.Endpoint', phoenix_action=>event, phoenix_layout=>#{'_'=>{'Elixir.PlausibleWeb.LayoutView',app}}, phoenix_controller=>'Elixir.PlausibleWeb.Api.ExternalController', phoenix_format=><<"json">>, phoenix_router=>'Elixir.PlausibleWeb.Router'}, scheme=>http, status=>nil, script_name=>[], state=>unset, host=><<"stats.hdsplus.co">>, cookies=>#{}, params=>#{}, '__struct__'=>'Elixir.Plug.Conn', halted=>false, assigns=>#{}, method=><<"POST">>, adapter=>{'Elixir.Plug.Cowboy.Conn',#{pid => <0.10632.0>,port => 80,
scheme => <<"http">>,version => 'HTTP/1.1',
path => <<"/api/event">>,
host => <<"stats.hdsplus.co">>,
peer => {{192,168,144,1},60416},
sock => {{192,168,144,2},8000},
bindings => #{},
ref => 'Elixir.PlausibleWeb.Endpoint.HTTP',
cert => undefined,
headers =>
#{<<"accept">> => <<"*/*">>,
<<"accept-encoding">> => <<"gzip, br">>,
<<"accept-language">> =>
<<"es-ES,es;q=0.9">>,
<<"cdn-loop">> => <<"cloudflare">>,
<<"cf-ipcontinent">> => <<"EU">>,
<<"cf-ipcountry">> => <<"ES">>,
<<"cf-iplatitude">> => <<"41.39490">>,
<<"cf-iplongitude">> => <<"2.17560">>,
<<"cf-ray">> => <<"86f90f1c0af68686-MAD">>,
<<"cf-region">> => <<"Catalonia">>,
<<"cf-region-code">> => <<"CT">>,
<<"cf-timezone">> => <<"Europe/Madrid">>,
<<"cf-visitor">> =>
<<"{\"scheme\":\"https\"}">>,
<<"content-length">> => <<"74">>,
<<"content-type">> => <<"text/plain">>,
<<"host">> => <<"stats.hdsplus.co">>,
<<"origin">> => <<"https://hdsplus.co">>,
<<"priority">> => <<"u=3, i">>,
<<"referer">> => <<"https://hdsplus.co/">>,
<<"sec-fetch-dest">> => <<"empty">>,
<<"sec-fetch-mode">> => <<"cors">>,
<<"sec-fetch-site">> => <<"same-site">>,
<<"user-agent">> =>
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15">>,
<<"x-forwarded-for">> =>
<<"83.44.134.248, 172.64.236.58">>,
<<"x-forwarded-proto">> => <<"https">>,
<<"x-forwarded-scheme">> => <<"https">>,
<<"x-real-ip">> => <<"172.64.236.58">>},
method => <<"POST">>,qs => <<>>,
path_info => undefined,streamid => 1,
body_length => 74,has_body => true,
host_info => undefined}}, secret_key_base=><<"jMI5V6xYzyfwHSHhYnluvqHKa69CdX7XOyKeh925wAOrpaq7yaZLQEovqh2mJJrbnuXSGZ0k0rHY0VxaQ4Q//w==">>, body_params=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', aspect=>body_params}, path_info=>[<<"api">>,<<"event">>], path_params=>#{}, query_params=>#{}, query_string=><<>>, remote_ip=>{192,168,144,1}, req_cookies=>#{}, req_headers=>[{<<"accept">>,<<"*/*">>},
{<<"accept-encoding">>,<<"gzip, br">>},
{<<"accept-language">>,<<"es-ES,es;q=0.9">>},
{<<"cdn-loop">>,<<"cloudflare">>},
{<<"cf-ipcontinent">>,<<"EU">>},
{<<"cf-ipcountry">>,<<"ES">>},
{<<"cf-iplatitude">>,<<"41.39490">>},
{<<"cf-iplongitude">>,<<"2.17560">>},
{<<"cf-ray">>,<<"86f90f1c0af68686-MAD">>},
{<<"cf-region">>,<<"Catalonia">>},
{<<"cf-region-code">>,<<"CT">>},
{<<"cf-timezone">>,<<"Europe/Madrid">>},
{<<"cf-visitor">>,<<"{\"scheme\":\"https\"}">>},
{<<"content-length">>,<<"74">>},
{<<"content-type">>,<<"text/plain">>},
{<<"host">>,<<"stats.hdsplus.co">>},
{<<"origin">>,<<"https://hdsplus.co">>},
{<<"priority">>,<<"u=3, i">>},
{<<"referer">>,<<"https://hdsplus.co/">>},
{<<"sec-fetch-dest">>,<<"empty">>},
{<<"sec-fetch-mode">>,<<"cors">>},
{<<"sec-fetch-site">>,<<"same-site">>},
{<<"user-agent">>,
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15">>},
{<<"x-forwarded-for">>,<<"83.44.134.248, 172.64.236.58">>},
{<<"x-forwarded-proto">>,<<"https">>},
{<<"x-forwarded-scheme">>,<<"https">>},
{<<"x-real-ip">>,<<"172.64.236.58">>}], request_path=><<"/api/event">>, resp_body=>nil, resp_cookies=>#{}, resp_headers=>[{<<"cache-control">>,<<"max-age=0, private, must-revalidate">>},
{<<"x-request-id">>,<<"F8NdfzMB-RhBddoAAPeC">>},
{<<"access-control-allow-credentials">>,<<"true">>},
{<<"access-control-allow-origin">>,<<"*">>},
{<<"access-control-expose-headers">>,<<>>}]})
WORKER ON
11:5:07.657798 <0.10637.0> 'Elixir.PlausibleWeb.RemoteIP':get(#{owner=><0.10637.0>, port=>80, private=>#{'Elixir.PlausibleWeb.Router'=>[], phoenix_view=>#{'_'=>'Elixir.PlausibleWeb.Api.ExternalView'}, plug_session_fetch=>done, plug_session=>#{}, before_send=>[#Fun<Elixir.Plug.Session.0.76384852>,#Fun<Elixir.Plug.Telemetry.0.54455629>], phoenix_endpoint=>'Elixir.PlausibleWeb.Endpoint', phoenix_action=>event, phoenix_layout=>#{'_'=>{'Elixir.PlausibleWeb.LayoutView',app}}, phoenix_controller=>'Elixir.PlausibleWeb.Api.ExternalController', phoenix_format=><<"json">>, phoenix_router=>'Elixir.PlausibleWeb.Router'}, scheme=>http, status=>nil, script_name=>[], state=>unset, host=><<"stats.hdsplus.co">>, cookies=>#{}, params=>#{}, '__struct__'=>'Elixir.Plug.Conn', halted=>false, assigns=>#{}, method=><<"POST">>, adapter=>{'Elixir.Plug.Cowboy.Conn',#{pid => <0.10636.0>,port => 80,
scheme => <<"http">>,version => 'HTTP/1.1',
path => <<"/api/event">>,
host => <<"stats.hdsplus.co">>,
peer => {{192,168,144,1},38690},
sock => {{192,168,144,2},8000},
bindings => #{},
ref => 'Elixir.PlausibleWeb.Endpoint.HTTP',
cert => undefined,
headers =>
#{<<"accept">> => <<"*/*">>,
<<"accept-encoding">> => <<"gzip">>,
<<"accept-language">> =>
<<"es-ES,es;q=0.9">>,
<<"cdn-loop">> =>
<<"cloudflare; subreqs=1">>,
<<"cf-ew-via">> => <<"15">>,
<<"cf-ipcontinent">> => <<"EU">>,
<<"cf-ipcountry">> => <<"ES">>,
<<"cf-iplatitude">> => <<"41.39490">>,
<<"cf-iplongitude">> => <<"2.17560">>,
<<"cf-ray">> => <<"86f90fae53e85e5c-MAD">>,
<<"cf-region">> => <<"Catalonia">>,
<<"cf-region-code">> => <<"CT">>,
<<"cf-timezone">> => <<"Europe/Madrid">>,
<<"cf-visitor">> =>
<<"{\"scheme\":\"https\"}">>,
<<"cf-worker">> =>
<<"hdsplus.workers.dev">>,
<<"content-length">> => <<"74">>,
<<"content-type">> => <<"text/plain">>,
<<"host">> => <<"stats.hdsplus.co">>,
<<"origin">> => <<"https://hdsplus.co">>,
<<"priority">> => <<"u=3, i">>,
<<"referer">> => <<"https://hdsplus.co/">>,
<<"sec-fetch-dest">> => <<"empty">>,
<<"sec-fetch-mode">> => <<"cors">>,
<<"sec-fetch-site">> => <<"cross-site">>,
<<"user-agent">> =>
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15">>,
<<"x-forwarded-for">> =>
<<"2a06:98c0:3600::103, 188.114.111.178">>,
<<"x-forwarded-proto">> => <<"https">>,
<<"x-forwarded-scheme">> => <<"https">>,
<<"x-real-ip">> => <<"188.114.111.178">>},
method => <<"POST">>,qs => <<>>,
path_info => undefined,streamid => 1,
body_length => 74,has_body => true,
host_info => undefined}}, secret_key_base=><<"jMI5V6xYzyfwHSHhYnluvqHKa69CdX7XOyKeh925wAOrpaq7yaZLQEovqh2mJJrbnuXSGZ0k0rHY0VxaQ4Q//w==">>, body_params=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', aspect=>body_params}, path_info=>[<<"api">>,<<"event">>], path_params=>#{}, query_params=>#{}, query_string=><<>>, remote_ip=>{192,168,144,1}, req_cookies=>#{}, req_headers=>[{<<"accept">>,<<"*/*">>},
{<<"accept-encoding">>,<<"gzip">>},
{<<"accept-language">>,<<"es-ES,es;q=0.9">>},
{<<"cdn-loop">>,<<"cloudflare; subreqs=1">>},
{<<"cf-ew-via">>,<<"15">>},
{<<"cf-ipcontinent">>,<<"EU">>},
{<<"cf-ipcountry">>,<<"ES">>},
{<<"cf-iplatitude">>,<<"41.39490">>},
{<<"cf-iplongitude">>,<<"2.17560">>},
{<<"cf-ray">>,<<"86f90fae53e85e5c-MAD">>},
{<<"cf-region">>,<<"Catalonia">>},
{<<"cf-region-code">>,<<"CT">>},
{<<"cf-timezone">>,<<"Europe/Madrid">>},
{<<"cf-visitor">>,<<"{\"scheme\":\"https\"}">>},
{<<"cf-worker">>,<<"hdsplus.workers.dev">>},
{<<"content-length">>,<<"74">>},
{<<"content-type">>,<<"text/plain">>},
{<<"host">>,<<"stats.hdsplus.co">>},
{<<"origin">>,<<"https://hdsplus.co">>},
{<<"priority">>,<<"u=3, i">>},
{<<"referer">>,<<"https://hdsplus.co/">>},
{<<"sec-fetch-dest">>,<<"empty">>},
{<<"sec-fetch-mode">>,<<"cors">>},
{<<"sec-fetch-site">>,<<"cross-site">>},
{<<"user-agent">>,
<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15">>},
{<<"x-forwarded-for">>,<<"2a06:98c0:3600::103, 188.114.111.178">>},
{<<"x-forwarded-proto">>,<<"https">>},
{<<"x-forwarded-scheme">>,<<"https">>},
{<<"x-real-ip">>,<<"188.114.111.178">>}], request_path=><<"/api/event">>, resp_body=>nil, resp_cookies=>#{}, resp_headers=>[{<<"cache-control">>,<<"max-age=0, private, must-revalidate">>},
{<<"x-request-id">>,<<"F8NdhKd16y-Y36EAAPiC">>},
{<<"access-control-allow-credentials">>,<<"true">>},
{<<"access-control-allow-origin">>,<<"*">>},
{<<"access-control-expose-headers">>,<<>>}]})
from analytics.
Do you know where x-forwarded-for
and x-real-ip
come from? One of them seems to be wrong. According to https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#x-forwarded-for CloudFlare adds the client IP address (the real IP address) to the beginning of the list. And since Plausible is reading it from the beginning of the list, it's not a bug in Plausible.
from analytics.
Related Issues (20)
- Check to determine if Clickhouse tables should be clustered is catastrophically flawed HOT 1
- It should be possible to bring up a Plausible self-hosted instance on a new, clean clustered Clickhouse HOT 2
- Proxied events being dropped? HOT 3
- cookie named "_plausible_key" exceeds maximum size of 4096 bytes HOT 7
- Browsing site with VPN gets events dropped HOT 7
- Logging plausible event results in CORS error HOT 6
- Docker self-host plausible/analytics:v2.0 doesn't track referer HOT 2
- Websocket connection failed on community edition HOT 13
- Issue when using SMTP mail (Bamboo SMTPAdapter) HOT 1
- Compatibity with Clickhouse 24.2 HOT 8
- Accept email for viewers link to settings which the viewer do not have access to HOT 4
- Pipe | is seen as "OR" when click for filtering
- /api/v1/sites/goals PUT endpoint results in 404 on Plausible v2.1.0-rc.0 HOT 3
- SVG map in shared link is not correctly aligned HOT 2
- Script is no longer <1kb HOT 2
- `file-types` causes an error in W3C Markup Validation Service
- Plausible logo in emails not visible HOT 1
- Mini Chart on Dashboard does not reset if the data has been resetted HOT 3
- Cannot log on to dashboard if using VPN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.