Nginx referer

The ngx_http_referer_module module is used to block access to a site for requests with invalid values in the “Referer” header field.

nano /etc/nginx/static.conf

valid_referers none blocked server_names ~\.google\. ~\.googleusercontent\. ~\.bing\. ~\.bingj\. ~\.baidu\. ~\.baiducontent\. ~\.so\. ~\.360webcache\. ~\.sogou\. ~\.sogoucdn\. ~\.chinaso\.;  
if ($invalid_referer) {  
    return 403;
}

expires max;