Answer the question
In order to leave comments, you need to log in
How to return geoip result in nginx?
Good afternoon!
Given: nginx with geoip2 connected.
Is it possible to make it so that when accessing a specific location (for example: /geoip) nginx gives the result of geoip2 work in json ??
I know, you can do something like this, but this is the header, and I want json, or at least to give text:
location /geoip {
add_header Cache-Control 'no-cache';
add_header GeoIP-Country-Code $geoip2_data_country_iso_code;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question