jsonip
gist.github.com
"server {
listen 80;
gzip on;
gzip_vary on;
gzip_types application/json;
add_header Access-Control-Allow-Methods GET;
add_header Access-Control-Allow-Origin *;
default_type application/json;
location = "/about" {
return 200 '{"About":"Inspired by jsonip.com"}';
}
location ~ ^/(.+)$ {
return 200 '$1({"ip":"$remote_addr","about":"/about"})';
}
location / {
if ($arg_callback != "") {
rewrite ^ /$arg_callback last;
}
return 200 '{"ip":"$remote_addr","about":"/about"}';
}
}"
#gists #code #free #open_source #json #ip_addresses #web_tools #nodejs #pub
Collect and share the web
Get started for free