gimme dat ip

So there’s something I use quite often to get the public IP of the host I’m using:

  • curl
  • curl

And now, introducing the new and improved (unlikely), IP returning URL. It has bells, it has whistles, it can clean and buff your car.

DBAG Tech Get IP

The idea is the following:

  • Client sends HTTP GET request for /getip
  • NGINX Docker container matches request path, and sends to explicit location match that does a proxypass to another internal Docker container
  • Sinatra web app with the following code
set :bind, ''

get '/' do

Some additional updates to my NGINX container:

  • Enabled HTTP2 (
  • Enabled HSTS (
  • Updated restart command for container due to not using a load balancer (cleaned up one liner for easier reading)
for i in $(aws ecs list-tasks --cluster cluster | jq -r .taskArns[]);
  GROUP=$(aws ecs describe-tasks --cluster cluster --tasks $i | jq -r .tasks[].group);
  if [ "$GROUP" = "service:website" ]; then
    aws ecs stop-task --cluster cluster --task $i;
Ryan Gravlin's Picture

About Ryan Gravlin

Over 25 years experience as a system operator.

Miami, FL