nginx 配置ip查询
配置如下:
location / { default_type text/plain; return 200 "$remote_addr\n"; } // 当然你也可以返回json格式的: location / { default_type application/json; return 200 "{\"ip\":\"$remote_addr\"}"; }
配置如下:
location / { default_type text/plain; return 200 "$remote_addr\n"; } // 当然你也可以返回json格式的: location / { default_type application/json; return 200 "{\"ip\":\"$remote_addr\"}"; }