#secure_link_modulem
#一、制定并允许检查请求的链接的真实性以及保护资源免遭未经授权的访问
#二、限制链接生效的周期、
#配置语法
Syntax: secure_link expression;
Default : ——
Context:http,server,location
Syntax: secure_link_md5 expression;
Default : ——
Context:http,server,location
#例:
#location / {
# secure_link $arg_md5,$arg_expires;
# secure_link_md5 "$secure_link_expires$uri jiamichuan";
#
# if ($secure_link = "") {
# return 403;
# }
#
# if ($secure_link = "0") {
# return 410;
# }
# }
#---------------------------------------------------------------------------------------------------------------------
#加密脚本
##!/bin/sh
##
#servername="my.server.name"
#download_file="/download/test.png"
#time_num=$(date -d "2019-10-18 00:00:00" +%s)
#secret_num="jiamichuan"
#
#res=$(echo -n "${time_num}${download_file} ${secret_num}"|openssl md5 -binary | openssl base64 | tr +/ -_ | tr -d =)
#
#echo "http://${servername}${download_file}?md5=${res}&expires=${time_num}"
#---------------------------------------------------------------------------------------------------------------------