Ah, encontrei na documentação (não vi isso antes). Parece bastante simples com o HttpRewriteModule .
Note: for curly braces( { and } ), as they are used both in regexes and for block control, to avoid conflicts, regexes with curly braces are to be enclosed with double quotes (or single quotes). For example, to rewrite URLs like:
/photos/123456 to:
/path/to/photos/12/1234/123456.png use the following (note the quotes enclosing the regex):
rewrite "/photos/([0-9] {2})([0-9] {2})([0-9] {2})" /path/to/photos/$1/$1$2/$1$2$3.png;