In Apache's mod_rewrite module there is a feature called RewriteMap. This allows an external program to be called to handle the redirects (allowing for more complicated redirecting).
Is there an equivalent feature for Nginx? I've looked at both the HttpMap and rewrite modules but can't find a way to do this for either.
Any pointers would be great.