参考了论坛几个朋友的规则,但是发现好像还是防不到,一到晚上客户的vps就跑满20Mbps,太悲剧了,想看看是不是盗链的原因,但是设置了规则却一直不生效!

  • server
  • {
  • listen 80;
  • server_name domains.com www.domains.com;
  • index index.html index.htm index.php default.html default.htm default.php;
  • root /home/wwwroot/domains.com;
  • - include none.conf;
  • location ~ .*\.(php|php5)?$
  • {
  • fastcgi_pass unix:/tmp/php-cgi.sock;
  • fastcgi_index index.php;
  • include fcgi.conf;
  • }
  • - location ~* .(gif|jpg|png|swf|flv)$ {
  • valid_referers none blocked www.domains.com *.domains.com;
  • if ($invalid_referer) {
  • return 403;
  • }
  • }
  • - location ~ .*\.(js|css)?$
  • {
  • expires 12h;
  • }
  • - access_log off;
  • }复制代码

特来请教一下,规则里面 domains.com 是客户的域名!麻烦大家帮忙看看