It may sound like a code golf question, but what is the simplest / lightest way to return $remote_addr
in text/plain
?
So, it should return several bytes of the IP address in a plain text.
216.58.221.164
Use case: An API to learn the client's own external (NAT), global IP address.
Is it possible to do it with Nginx alone and without any backends? If so, how?