K
K
Konstantin Khairov2019-01-20 18:16:06
Nginx
Konstantin Khairov, 2019-01-20 18:16:06

Why does Nginx Secure_Link_Module work erroneously?

Hello. I use for video this link encryption config
secure_link $arg_md5,$arg_time;
secure_link_md5 secret_key$remote_addr$arg_time;
if ($secure_link = "") {
return 403;
}
if ($secure_link = "0") {
return 404;
}
In php, this is the script

$secret = "secretkey";
  $time = time() + 86400; 
  $key = str_replace("=", "",strtr(base64_encode(md5($secret.$_SERVER['REMOTE_ADDR'].$time, TRUE)), "+/", "-_"));

Works great for me personally, no problems when viewing and 98% of users have no problems. But there are 2% of users who don’t start the video at all, give out 403 that the link is outdated, checked it and the key that the users are going to have is correct, but still doesn’t work for them. In general, most of the non-working users come from the phone.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question