Jump to content


Issue with geolocation resolution

geolocation

3 replies to this topic

#1 IonutZ

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 05 June 2018 - 02:17 PM

Hey there,

I have installed Livezilla on my main website. I really like the functionality and would like to make use of geolocation / geotracking as well. Someone on the Livezilla Facebook site guided me to how to resolve the IP address of my visitors because I'm using nginx / varnish and REMOTE_ADDR was resolving to 127.0.0.1 (I ended up using HTTP_X_REAL_IP if anyone that runs into the same issue sees this).

My problem now is that even though the visitor IPs are coming through fine, Livezilla thinks everyone is from New York, New York (under Location -> Region / City).

Since I'm using varnish, I made sure not to be caching any request that goes to the "livezilla" folder using this code under vcl_recv:

  # Don't cache livezilla
  if (req.url ~ "^/livezilla") {
	return (pass);
  }

Also, kept getting this error as well in my Chrome console:

Refused to execute script from 'https://www.domain.com/livezilla/geo.php?aid=1&sid=xx==&dbp=1&gv=1023&method=lz_tracking_geo_result&spanm=lz_tracking_set_geo_span&oak=xx' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

In order to fix this, I added a header to geo.php

header('Content-Type: application/javascript;charset=utf-8');


Right now I either get dashes for Region and City, or New York, New York. Does anyone have any ideas what I could do to fix this?

#2 Patrick Keil

    Administrator

  • Administrators
  • 3563 posts
  • LocationSingen, Germany

Posted 06 June 2018 - 06:20 AM

Hi,

Thanks for your thoughts, highly appreciated.

1.) The Geo Tracking uses REMOTE_ADDR and ignores the server configuration PHP IP server param. We will change that with the next update 7.1.0.3.

2.) We will add the MIME type right away, thanks for bringing this to our attention.

Cheers.

#3 IonutZ

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 06 June 2018 - 04:36 PM

Could you tell me where that variable is set at so I can change it in the code without having to look for it? :)

#4 Patrick Keil

    Administrator

  • Administrators
  • 3563 posts
  • LocationSingen, Germany

Posted 07 June 2018 - 08:22 AM

Hi,

both changes need to be applied to "geo.php".

Hope that helps.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users