Cloudflare Workers not work with Countries #3978
-
Past Issues Searched
Issue is a Bug Report
Using official Plausible Cloud hosting or self-hosting?Self-hosting Describe the bugWhen you enable the Plausible method with Cloudflare workers (https://plausible.io/docs/proxy/guides/cloudflare). Expected behaviorPlausible should update the UI, the visitor map by country, by having CloudFlare workers enabled. ScreenshotsNo response EnvironmentNo response |
Beta Was this translation helpful? Give feedback.
Replies: 25 comments 8 replies
-
The last time I tried cf workers, everything was working as expected: #2137 (comment) Could you please share more of your setup? |
Beta Was this translation helpful? Give feedback.
-
Hi @ruslandoga All statistics are displayed correctly, except the Map with the country / region / city of the visitors. It does not show anything. I have Plausible with Nginx Proxy Manager (without additional HTTP headers. The problem is that it is not reflected in the UI. |
Beta Was this translation helpful? Give feedback.
-
Would you be able to share your configuration files, including nginx, worker scripts, and anything else that seems relevant? |
Beta Was this translation helpful? Give feedback.
-
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) |
Beta Was this translation helpful? Give feedback.
-
I have executed this inside Plausible remote. But I don't know how to check it with my domain. Sorry.
My Worker Script is the same of yours (changing only my domain). My Nginx conf for the Plausible domain:
|
Beta Was this translation helpful? Give feedback.
-
I execute Plausible GeoIP command with this IP, but in the UI not appear... with Workers enabled. ![]() ![]() |
Beta Was this translation helpful? Give feedback.
-
Ant the output for this command (in case it helps.) ![]() |
Beta Was this translation helpful? Give feedback.
-
You would need to visit your site which would make an |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
If I access with an IP from Portugal: With Worker Without Worker ![]() 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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help.
|
Beta Was this translation helpful? Give feedback.
-
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) |
Beta Was this translation helpful? Give feedback.
-
Sorry, on which console do I view the trace? The Plausible console does not show anything new.
![]() |
Beta Was this translation helpful? Give feedback.
-
If it doesn't show anything, then there are no requests reaching Plausible. Try running it with the Worker deactivated. |
Beta Was this translation helpful? Give feedback.
-
Neither... The Plausible remote console does not show anything new after executing these commands. |
Beta Was this translation helpful? Give feedback.
-
Ok, I see. I guess you are on v2.1.0-rc.0? The module name changed from |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Please post the traces as code or text snippet. It would be easier to debug. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Yes. |
Beta Was this translation helpful? Give feedback.
-
Do you know where |
Beta Was this translation helpful? Give feedback.
-
I suggest checking nginx configuration. |
Beta Was this translation helpful? Give feedback.
-
**Update: @ruslandoga ** I have already found the "problem". But...., if you have the domain as "Proxied" in CloudFlare DNS it does NOT work. Since it already masks the real IP of the Host with a CloudFlare IP. You can try it if you want. |
Beta Was this translation helpful? Give feedback.
Now yes.... finally...
I added to NGINX:
And now.. alls works!!
Thanks you so much :)