Compare commits
2 Commits
0fd9612adf
...
e56cb3a793
| Author | SHA1 | Date | |
|---|---|---|---|
| e56cb3a793 | |||
| 81bb870c01 |
31
nginx.conf
31
nginx.conf
@ -2,7 +2,7 @@ user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
|
||||
#include /etc/nginx/modules-enabled/*.conf;
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
@ -52,17 +52,19 @@ http {
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
#geoip2 /etc/GeoLite2-Country.mmdb {
|
||||
# auto_reload 5m;
|
||||
# $geoip2_metadata_country_build metadata build_epoch;
|
||||
# $geoip2_data_country_code default=US source=$http_x_forwarded_for country iso_code;
|
||||
# $geoip2_data_country_name source=$http_x_forwarded_for country names en;
|
||||
#}
|
||||
geoip2 /var/lib/GeoIP/GeoLite2-Country.mmdb {
|
||||
auto_reload 5m;
|
||||
$geoip2_metadata_country_build metadata build_epoch;
|
||||
$geoip2_data_country_code default=US source=$http_x_forwarded_for country iso_code;
|
||||
$geoip2_data_country_name source=$http_x_forwarded_for country names en;
|
||||
}
|
||||
|
||||
#geoip2 /etc/GeoLite2-City.mmdb {
|
||||
# $geoip2_data_city_name source=$http_x_forwarded_for city names en;
|
||||
# $geoip2_data_time_zone source=$http_x_forwarded_for location time_zone;
|
||||
#}
|
||||
geoip2 /var/lib/GeoIP/GeoLite2-City.mmdb {
|
||||
$geoip2_data_city_name source=$http_x_forwarded_for city names en;
|
||||
$geoip2_data_latitude location latitude;
|
||||
$geoip2_data_longitude location longitude;
|
||||
$geoip2_data_time_zone source=$http_x_forwarded_for location time_zone;
|
||||
}
|
||||
|
||||
log_format json_analytics escape=json '{'
|
||||
'"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
|
||||
@ -101,8 +103,11 @@ http {
|
||||
'"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0
|
||||
'"pipe": "$pipe", ' # "p" if request was pipelined, "." otherwise
|
||||
'"gzip_ratio": "$gzip_ratio", '
|
||||
'"http_cf_ray": "$http_cf_ray"'
|
||||
#'"geoip_country_code": "$geoip_country_code"'
|
||||
'"http_cf_ray": "$http_cf_ray",'
|
||||
'"geoip_city_name": "$geoip2_data_city_name",'
|
||||
'"geoip_latitude": "$geoip2_data_latitude",'
|
||||
'"geoip_longitude": "$geoip2_data_longitude",'
|
||||
'"geoip_country_code": "$geoip2_data_country_code"'
|
||||
'}';
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user