文档说明:只记录关键地方;
nginx 获得IP地址
default.conf 配置如下
# 返回json格式
location /ip/json {
charset utf-8;
default_type application/json;
return 200 '{
"request_time":"$time_local",
"ip":"$remote_addr",
"port":"$remote_port",
"message":"获取到IP地址啦!
标签:IP,script,ip,nginx,json,callback,IP地址,客户端
From: https://www.cnblogs.com/jingjingxyk/p/16853133.html