In Nginx, how can I select the bold part of the URL below? 2013 and 12 are relative to the date so the rule needs to be flexible to work future locations.
example.com/wp-content/uploads/2013/12/sometime.pdf
The end result should look something like: index.php?method=2013/12/sometime.pdf
Current rewrite rule
I have tried with the following but this will only return the last letter of the URL.
rewrite ^/wp-content/uploads/2013/12/sometime.pdf /index.php?method=$1
Thanks!