Nginx防盗链模块ngx_http_secure_link_module

    Read

防盗链可以解决网站资源被其他网站盗用,节约带宽,避免原创版权被非版权费盗用。Nginx的官方模块ngx_http_secure_link_module可以很好的解决资源被盗用的问题。

实验步骤:SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

1、编译模块:SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

--with-http_secure_link_module; SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

2、模块secure_link_secret word:SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/


URL生成方法:
1:密码:passwd
2:文件:video.mp4
3:MD5加密:echo -n 'video.mp4passwd' | openssl dgst -md5
4:访问地址:http://localhost/s/146b9a69c11eceb3c67865c2fd9abfe5/video.mp4
#146b9a69c11eceb3c67865c2fd9abfe5 为 文件+密码计算出的结果 SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

3、secure_link_md5加密方法SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/


URL生成方法:
shell脚本:

生成的地址:http://localhost/media/video.mp4?md5=TC291LXl9Dlvau7vDRRFkQ&expires=1513872000 SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

参考文档:
1:http://nginx.org/en/docs/http/ngx_http_secure_link_module.html#secure_link_md5SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/ SourceByrd's Weblog-https://note.t4x.org/environment/nginx-http-secure-link-module/

申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on December 21, 2018
  • 原文链接:https://note.t4x.org/environment/nginx-http-secure-link-module/