莫莫同学の私家后花园

  • 使用示例(Shell脚本):
  • 首页
  • 分享
  • 记录
  • 文章归档
  • 榜上有名
  • 友亲链接
  • 关于本站

整理收集 获取IP的服务

  • Momostudent
  • 2020-08-05
  • 0

允许使用 CURL:
ip.threep.top
ifconfig. io
ip.fm
cip.cc
myip.ipip.net
ip.sb
ifconfig.me
checkip.dyndns.com
api.myip.com
其他

ip.coderbusy.com

使用示例(Shell脚本):
<span class="token important">#!/bin/sh</span>
ip<span class="token operator">=</span>$<span class="token punctuation">(</span>curl <span class="token operator">-</span>s https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>api<span class="token punctuation">.</span>ip<span class="token punctuation">.</span>sb<span class="token operator">/</span>ip<span class="token punctuation">)</span>
<span class="token keyword">echo</span> <span class="token string">"My IP address is: <span class="token property">$ip</span>"</span>

nginx直接返回服务者IP配置:
location / {
default_type text/plain;
return 200 "$remote_addr\n" ;
}

//如果显示的IP不正确,可能使用了防火墙cdn之类的,可以试试 把$remote_addr改成$http_x_forwarded_for

© 2023 莫莫同学の私家后花园
Theme by Wing
浙ICP备15001316号 浙公网安备 33048302000438号
  • {{ item.name }}
  • {{ item.name }}