Geo location always shows hosted server location

13 views
Skip to first unread message

Ivan

unread,
Jan 30, 2023, 1:59:40 PM1/30/23
to dotCMS User Group
When I use the $visitor.geo object in my velocity code, I always get the location of my hosted server, not the user's location. I tried it on the demo.dotcms.com site and it works correctly there, showing my actual location. Are there any additional settings that need to be set in order for it to work? 

Will Ezell

unread,
Jan 30, 2023, 2:06:55 PM1/30/23
to dot...@googlegroups.com
Most likely, you are running behind a reverse proxy and that is the ip that is being resolved.  You will need to configure your reverse proxy to send the correct X-FORWARDED_FOR headers and edit your server.xml to include Tomcat's Remote IP valve.


On Mon, Jan 30, 2023 at 1:59 PM Ivan <iblag...@gmail.com> wrote:
When I use the $visitor.geo object in my velocity code, I always get the location of my hosted server, not the user's location. I tried it on the demo.dotcms.com site and it works correctly there, showing my actual location. Are there any additional settings that need to be set in order for it to work? 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b45e1e9c-54e7-486e-a87d-224896300761n%40googlegroups.com.


--



382 NE 191st St #92150
Miami, Florida 33179-3899
Main: 
305-900-2001 | Direct: 978.294.9429

Reply all
Reply to author
Forward
0 new messages