From ac187443c7b925ea574d766ef70ae001a57640f9 Mon Sep 17 00:00:00 2001 From: JavaOliverLu Date: Wed, 21 May 2025 22:19:08 +0800 Subject: [PATCH] Add xml return format --- nginx/conf.d/ipinfo.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx/conf.d/ipinfo.conf b/nginx/conf.d/ipinfo.conf index a21c46e..14ac9de 100644 --- a/nginx/conf.d/ipinfo.conf +++ b/nginx/conf.d/ipinfo.conf @@ -60,6 +60,10 @@ server { default_type application/json; return 200 "{\"ip\":\"$remote_addr\",\"country_code\":\"$ip_country_code\",\"country_name\":\"$ip_country_name\",\"asn\":\"$ip_asn\",\"as_desc\":\"$ip_aso\",\"user_agent\":\"$http_user_agent\"}\n"; } + location = /xml { + default_type application/xml; + return 200 "\n\n $remote_addr\n $ip_country_code\n $ip_country_name\n $ip_asn\n $ip_aso\n $http_user_agent\n\n"; + } location = /build_epoch { default_type application/json; return 200 "{\"GeoLite2-Country\":\"$ip_country_build_epoch\",\"GeoLite2-ASN\":\"$ip_as_build_epoch\"}\n";