title: Nginx - Redirect url for certain file type
body: <p>I have nginx 1.2.1. I want to rewrite:</p>
  
  <p><code>http://mywebsite.com/[token].mp4</code> to <code>http://mywebsite.com/get.php?token=[token]</code></p>
  
  <p>Return error 404, my block:</p>
  
  <pre><code>location ~* \.(mp4)$ {
      rewrite "^/([a-zA-Z0-9]{23})\$" /get.php?token=$1 break;
  }
  </code></pre>
  
  <p>I tried <a href="https://serverfault.com/questions/526409/nginx-rewrite-how-to-redirect-url-for-certain-file-type">this question</a> but nothing, it returns error 404</p>