server {
  server_name www.example1.com;
 root     /data/www/www.example1.com;
location /timedfolder {
            secure_download on;
            secure_download_secret IAmSalt$remote_addr;
            secure_download_path_mode file;
 
            if ($secure_download = "-1") {
                rewrite /expired.html break;
            }
            if ($secure_download = "-2") {
                rewrite /bad_hash.html break;
            }
            if ($secure_download = "-3") {
                return 500;
            }

            rewrite ^(.*)/[0-9a-zA-Z]*/[0-9a-zA-Z]*$ $1 break;
}
}