

























Sometimes you just need your public IP, and nothing more. A simple config change in nginx can offer you exactly this.
Add the following location segment to the server segment of your choice. You could replace /ip with another term.
location /ip { default_type text/plain; return 200 $remote_addr;}
Now, if you visit the destination of the server segment with the subdirectory /ip, you'll find your IP. Try it out and visit https://brrl.net/ip.
curl brrl.net/ipwget -qO- brrl.net/ipInvoke-RestMethod brrl.net/ip or irm brrl.net/ipDepending on your setup, some tweaking is necessary in regards to TLS, redirects, and so on.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。