Código PHP:
Ver original
$expire = time()+3600; // At which point in time the file should expire. time() + x; would be the usual usage. $md5 = strtr($md5, '+/', '-_'); // + and / are considered special characters in URLs, see the wikipedia page linked in references. $md5 = str_replace('=', '', $md5); // When used in query parameters the base64 padding character is considered special. echo 'http://dominio/video/'.$md5.'/'.$expire.'/video.mp4';
para poder obtener la url de esta manera
http://dominio/video/9G_OPrzufyoMZ6s...3961/video.flv
pero en el servicio nginx tengo esto
Código Apache:
Ver original
location /video/ { rewrite /video/([a-zA-Z0-9_\-]*)/([0-9]*)/(.*)\.flv$ /flv/$3.flv?st=$1&e=$2; } location /flv/ { internal; secure_link $arg_st,$arg_e; secure_link_md5 1234$arg_e; if ($secure_link = "") { return 403; } if ($secure_link = "0") { return 403; } root html; flv; add_header Cache-Control 'private, max-age=0, must-revalidate'; add_header Strict-Transport-Security "max-age=16070400; includeSubdomains"; add_header X-Frame-Options DENY; }
mi pregunta es si es posible que automatico el servicio nginx haga eso automatico