nginx接口安全验证模块ngx_http_secure_link_module
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; }
`
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29