nginx的下载连接限制和防盗链WEB服务器 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

   

    限制每个IP一个线程,每个线程20K/s限制;

    防治盗链,将盗链的URL显示为指定图片;

    在171上测试通过,

nginx的下载连接限制和防盗链WEB服务器

    一、下载限制。

    http {

    limit_zone one $binary_remote_addr 10m;

    server {

    location /upload/ {

    limit_conn one 1;

    limit_rate 20k;

    }

    }

    }

    http://wiki.codemongers.com/NginxHttpLimitZoneModule

    二、防止盗链,

电脑资料

nginx的下载连接限制和防盗链WEB服务器》(https://www.unjs.com)。

    location /upload/ {

    valid_referers none blocked server_names *.www.wp1998.cn;

    if ($invalid_referer) {

    rewrite ^/ http://www.wp1998.cn/images/error.gif

    #return  403;

    }

    }​

最新文章