What's $0 in nginx? (mod_rewrite)

Viewed 1313

I'm trying convert my Apache rewrite rules for my new nginx webserver, but I'm having problems translating this particular line:

RewriteRule ^(arin|barry|john|ross|danny).*$ /share/$0 [NC]

As for my old Apache server, this rule caused

http://example.com/danny/awesomeVideo.avi to view http://example.com/share/danny/awesomeVideo.avi instead, without the link changing.

To be honest, as my Apache setup was a long time ago, I'm not even sure whether or not the link not changing in the address bar for someone who views the file was due to this rule or not.

Most online converters will propose this rule for nginx:

rewrite ^/(arin|barry|john|ross|danny).*$ /share/$0 last;

Unfortunately, $0 seems to be faulty, as this is what I get when restarting nginx:

Restarting nginx: nginx: [emerg] unknown "0" variable

nginx: configuration file /etc/nginx/nginx.conf test failed`

Does anyone know how to express Apache's $0 in nginx?

1 Answers
Related