Skip to content

Commit 82e0743

Browse files
committed
update geoip
1 parent 700b9d5 commit 82e0743

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

files/etc/nginx/sites-enabled/1-geoip.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
server {
22
listen 127.0.0.1:9081;
3-
server_name localhost-geoip2;
3+
resolver 8.8.8.8 8.8.4.4 ipv6=off;
4+
access_log off;
45

56
location / {
67
charset utf-8;
78
add_header Cache-Control no-cache;
9+
add_header access-control-allow-methods "OPTIONS,GET";
10+
add_header access-control-allow-credentials "true";
11+
add_header access-control-allow-headers "authorization,x-csrf-token,x-requested-with";
812

913
default_type application/json;
1014
set $mybody '{"ip":"$realip","country_code":"$geoip2_country_code","region_code":"$geoip2_region_code","region_name":"$geoip2_region","city":"$geoip2_city","zip_code":"$geoip2_postal_code","latitude":"$geoip2_latitude","longitude":"$geoip2_longitude","metro_code":"$geoip2_dma_code"}';

0 commit comments

Comments
 (0)