Skip to content

Instantly share code, notes, and snippets.

@gotche
Last active August 29, 2015 13:57
Show Gist options
  • Save gotche/9729551 to your computer and use it in GitHub Desktop.
Save gotche/9729551 to your computer and use it in GitHub Desktop.
ifconfig.me implemented in nginx
location / {
content_by_lua "ngx.say(ngx.var.remote_addr)";
}
# to build nginx you have to install lua and grab the modules
# libluajit-5.1-dev
# ./configure --prefix=/opt/nginx --add-module=/builds/ngx_devel_kit-0.2.19 --add-module=/builds/lua-nginx-module-0.9.6
# just follow the installation instructionshttp://wiki.nginx.org/HttpLuaModule#Installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment