title: NGINX secure link not working
body: <p>I setup NGINX on CentOS and set config file to prevent direct access video file.
  This is example code that I use.</p>
  
  <pre><code>    location /videos/ {
      valid_referers none blocked abccc.com;
      if ($invalid_referer) {
          return 403;
      }   
       root      /var/cdn/videos/;
  
      ## This must match the URI part related to the MD5 hash and expiration time.
      secure_link $arg_st,$arg_e;      
      ## The MD5 hash is built from our secret token, the URI($path in PHP) and our expiration time.
      secure_link_md5 Gf1Pv52EifS1f8G9agn2k2n8a$uri$arg_e;         
      ## If the hash is incorrect then $secure_link is a null string.
      if ($secure_link = "") {
          return 403;
      }        
      ## The current local time is greater than the specified expiration time.
      if ($secure_link = "0") {
          return 403;
      }
  
      gzip off;
      gzip_static off;
      mp4;
      flv;
      mp4_buffer_size        5M;
      mp4_max_buffer_size    10M;
      #mp4_limit_rate        on;
      #mp4_limit_rate_after  30s;     
  
      ## If everything is ok $secure_link is 1.
      rewrite ^/videos/(.*)$ /videos/$1 break;
  }
  </code></pre>
  
  <p>But when restart server and test it, I still access video file in folder via
  direct url and secure link.</p>
  
  <p>Other wise when I try to use this configuration in localhost, it work perfectly.</p>
  
  <p>What's I do wrong?</p>