Comments on How to use GeoIP with Nginx on Ubuntu 16.04
This tutorial explains how to use the GeoIP module with nginx on Ubuntu 16.04 to find out where your visitors come from. The GeoIP module sets multiple variables like $geoip_country_name, $geoip_country_code, $geoip_city, etc. that you can use in your PHP scripts or directly in your nginx configuration, for example to serve content in different languages based on the user's country.
7 Comment(s)
Comments
"for example to serve content in different languages based on the user's country"
You deserve a slap in the face for that one.
No, I do not necessarily speak the the local language if the place I'm currently accessing your site from. I have set the Accept-Languag HTTP header exactly for that reason, and I expect it to be honoured, especially if it's not the default language for the region I'm currently traversing.
There can be regulations depending on the country which require showing different pages. Be happy if you don't need it in your country.
It doesn't work at all. In nginx I get worker process 11 error amd with curl SSLReadError, nginx 1.6.2
Your errors are SSL errors and not errors from this GeoIP setup. Check your SSL config that you must have made beside the setup described here to fix your SSL issues.
Yes? So please explain me why it vanish when I comment (#) the geoip directive in nginx.conf ? Suddenly everything start working.
It doesn't work for me. I've post on Stackoverflow my pb : https://stackoverflow.com/questions/46770737/nginx-geoip-environment-variables-undefined If you can help it would be great. thanks
Hey, I was wondering could you make a guide that involes GeoIP2? Sinds it works a little different.
The GeoIP is not longer supported for downloadSource: https://support.maxmind.com/geolite-legacy-discontinuation-notice/
I hope you can sinds I am kinda stuck :(
Regards