添加了允许列表内的域名才可以使用站点资源。

 

<Directory "/wwwroot/mysite">
    SetOutputFilter DEFLATE
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    DirectoryIndex index.html index.php
	Header set Access-Control-Allow-Origin "*"
	SetEnvIfNoCase Referer "^$" local_ref
	SetEnvIfNoCase Referer "mysite.com/.*$" local_ref
	SetEnvIfNoCase Referer "www.mysite.com/.*$" local_ref
    SetEnvIfNoCase Referer "yoursite.com/.*$" local_ref
	<filesmatch "\.(mp3|jpeg|pdf|png|jpg|gif)">
        Require all denied
        Require env local_ref
    </filesmatch>
</Directory>

 

Centos+Apache站点配置站内静态资源防盗链
https://fanly.net/article/5MjUu0MzJk
转载请注明出处,谢谢!