Like PHP's die() or ruby's raise, but for nginx config files.
Option 1, have external webservice to echo out the variable of interest:
rewrite ^ http://httpbin.org/get?abuse=$abuse last; break;
Option 2: just include it in HTTP headers:
root /var/www/nginx-default;
location / {
add_header X-nginx-abuse $abuse;
add_header X-nginx-bad-bot $bad_bot;
try_files $uri @apache;
}
location @apache {
proxy_pass http://127.0.0.1:80;
proxy_set_header Host $host;
}
Note that add_header doesn't work on pages with error (404/403/etc), see see http://wiki.nginx.org/HttpHeadersModule#add_header