安全

防盗链

  1. location ~* \.(gif|jpg|png)$ {
  2. # 只允许 192.168.0.1 请求资源
  3. valid_referers none blocked 192.168.0.1;
  4. if ($invalid_referer) {
  5. rewrite ^/ http://$host/logo.png;
  6. }
  7. }