Skip to content

Instantly share code, notes, and snippets.

View brownian's full-sized avatar

Dmytro O. Redchuk brownian

View GitHub Profile
@brownian
brownian / gist:0f6f8333f9f3a45c5b1812a2193fcfaa
Created December 31, 2021 07:55
Посилання для «власної пошукової системи»
https://www.google.com/search?q=%s+-и&sourceid=chrome&ie=UTF-8&hl=uk&lang=uk
@brownian
brownian / nginx.conf.md
Created July 16, 2024 11:58
nginx: how to workaround "and"/"or" for geoip2 locations

This code will set $allowed_city to "yes" if request made from Ukraine (or any other allowed country) OR from Krakow (or any other allowed city).

In /etc/nginx/nginx.conf:

        geoip2 /path/to/GeoLite2-City.mmdb {
                $geoip2_data_city_name          city names en;
 $geoip2_data_country_iso_code country iso_code;