http_referer 白名单

    valid_referers none blocked *.ttlsa.com server_names ~\.image\. ~\.baidu\.;
    if ($invalid_referer) {
        return 403;


例如:
server {
        listen 80;
        server_name test.image.xxxxxxx.com;
        location / {
                proxy_pass http://test.image_pools;
                proxy_set_header Host           $host;
                proxy_set_header X-Real-IP      $remote_addr;
                proxy_set_header X-Forwoarded-For       $proxy_add_x_forwarded_for;
                }
    valid_referers none blocked *.ttlsa.com server_names ~\.image\. ~\.baidu\.;
    if ($invalid_referer) {
        return 403;
    }
 }
配置 到*.ttlsa.com的referer通过,如果有*.image.*,*.baidu.*的通过

 

posted @ 2017-09-10 10:00  bass  阅读(3074)  评论(1编辑  收藏  举报