码迷,mamicode.com
首页 > Web开发 > 详细

nginx接口安全验证模块ngx_http_secure_link_module

时间:2020-05-08 13:04:56      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:ons   ati   sum   lin   check   sign   sig   version   pass   

location配置

`
location ~ ^/v1/(reward|exchange)/ {
set $channel_name $cookie_channel_name;
secure_link $arg_sign,$arg_et;
secure_link_md5 "$uri $arg_version_name $channel_name $arg_et gohell";

        set $check_status "";

        # checksum
        if ($secure_link = "") {
            set $check_status 403;
        }
        if ($arg_nonce_str = "") {
            set $check_status 200;
        }
        # expire
        if ($secure_link = "0") {
            set $check_status 410;
        }
        if ($arg_sign = "") {
            set $check_status 504;
        }
        if ($arg_version_name = "1.1.4.7") {
            set $check_status 200;
        }
        if ($arg_mmmm != "") {
            set $check_status 200;
        }
        if ($check_status = 403) {
            return 403;
        }
        if ($check_status = 410) {
            return 410;
        }
        if ($check_status = 504) {
            return 504;
        }

        proxy_pass http://127.0.0.1:10001;
    }


    location / {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Methods ‘GET, POST, OPTIONS‘;
        add_header Access-Control-Allow-Headers ‘DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization‘;

        proxy_pass http://127.0.0.1:10001;
    }

`

nginx接口安全验证模块ngx_http_secure_link_module

标签:ons   ati   sum   lin   check   sign   sig   version   pass   

原文地址:https://www.cnblogs.com/lanlingshao/p/12849702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!