1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        nginx-lua-ds-hotlink防盜鏈系統(tǒng)

        聯(lián)合創(chuàng)作 · 2023-10-01 15:46

        基于nginx和lua的防盜鏈系統(tǒng)

        A Prevent Hotlinking System based on nginx and lua

        將代碼放在位于nginx根目錄下的lua/ds_hotlink/下

        Put the code into the directory lua/ds_hotlink which is located in the root directory of the nginx

        在nginx.conf的http段中添加如下配置:

        Add the config below to the http seg in nginx.conf:

        lua_package_path "/u/nginx/lua/ds_hotlink/?.lua;;";
            init_by_lua_file lua/ds_hotlink/init.lua;

        配置如下location用于獲取訪問key

        Add the config below to /get_key location for geting access key

        location = /get_key {
                allow 10.0.2.2;
                deny all;
                content_by_lua_file lua/ds_hotlink/get_key.lua;
            }

        在需要防盜鏈的location下配置如下

        Add the config below to a location which need to prevent hotlinking

        access_by_lua_file lua/ds_hotlink/refer.lua;

        或者配置如下

        Alternative config below

        access_by_lua_file lua/ds_hotlink/accesskey.lua;

        防盜鏈相關(guān)的配置在config.lua中,需要保證nginx的worker process對(duì)日志文件有讀寫權(quán)限

        You can config Prevent Hotlinking System with the file config.lua,and you must make the worker process of nginx have the read and write permission to the log file

        瀏覽 15
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            中文字幕一区二区三区日本在线 | 丰满秘书3伦理 | 干逼无码| 特级特黄A片一级一片亲下面 | 在线黄色视频网 | 九哥操比网 | 午夜一级影院 | 高清HD.Videos黑人亚洲女小琴 | 蜜桃视频网站18 | 老司机毛片 |