location下面添加核心代码

valid_referers none blocked server_names *.thago.cn;
if ($invalid_referer) {
    return 403;
}