config
location / {
secure_link $arg_st,$arg_e;
secure_link_md5 "$uri$arg_e";
if ($secure_link = "") { return 405; }
if ($secure_link = 0) { return 410; }
}
php
$file="logo.png";
$secret_word = "secret";
$uri_prefix = "http://***.com/";
$time = time()+600;
$md5 = base64_encode(md5($file.$time, true));
$md5 = strtr($md5, '+/', '-_');
$md5 = str_replace('=', '', $md5);
echo $url= $uri_prefix.$file.'?st='.$md5.'&e='.$time;
这是重用的,但错误403错误:
http://***.com/logo.png?st = rSAA-10mNyPeZ34N8ND05g&e = 1549389964