init - PoC
This commit is contained in:
commit
3484b45045
146 changed files with 10657 additions and 0 deletions
19
items/2022-11-17_long_nginx-check-your-public-ip.md
Normal file
19
items/2022-11-17_long_nginx-check-your-public-ip.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Nginx - check your public IP
|
||||
|
||||
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](https://brrl.net/ip).
|
||||
|
||||
The neat part is that it works well in the CLI too:
|
||||
: `curl brrl.net/ip`
|
||||
: `wget -qO- brrl.net/ip`
|
||||
: Powershell
|
||||
: `Invoke-RestMethod brrl.net/ip` or `irm brrl.net/ip`
|
||||
|
||||
Depending on your setup, some tweaking is necessary in regards to TLS, redirects, and so on.
|
||||
|
||||
---
|
||||
Loading…
Add table
Add a link
Reference in a new issue