
[root@static ~]# grep -Pv '^$|^ *#' /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
location ~ \.(jpg|png|css|js)$ {
root /usr/share/nginx/html;
valid_referers none blocked www.sharkyun.com;
if ($invalid_referer) {
return 403;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}


可以查看日志 /var/log/nginx/access.log,確認 referer 的值為短橫線 - ,也就是 none

cruel -e 引數可以在請求頭中設定 referer 的值






轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/194327.html
標籤:其他
