让nginx的expires和防盗链都有效
expires有效,防盗链失效
location ~* ^.+\.(jpg|jpeg|gif|png|css|js|swf)$ { access_log off; root /opt/app/xuexi6; expires 1h; #break; } location ~* ^.+\.(jpg|jpeg|gif|png|swf|rar|zip)$ { valid_referers none blocked *.xuexi6.com; if ($invalid_referer) { rewrite ^/ http://www.xuexi6.com/404.gif; return 412; } }
只有js和css的expire有效,防盗链有效
location ~* ^.+\.(jpg|jpeg|gif|png|swf|rar|zip)$ { valid_referers none blocked *.xuexi6.com; if ($invalid_referer) { rewrite ^/ http://www.xuexi6.com/404.gif; return 412; } } location ~* ^.+\.(jpg|jpeg|gif|png|css|js|swf)$ { access_log off; root /opt/app/xuexi6; expires 1h; #break; }
expire和防盗链都有效
location ~* ^.+\.(jpg|jpeg|gif|png|swf|rar|zip|css|js)$ { valid_referers none blocked *.xuexi6.com; if ($invalid_referer) { rewrite ^/ http://www.xuexi6.com/404.gif; return 412; } access_log off; root /opt/app/xuexi6; expires 1h; break; }
相关推荐
WasteLand 2020-06-13
咻咻ing 2020-05-10
jxiao000 2020-04-30
SZStudy 2020-04-16
SZStudy 2020-02-10
houjinkai 2020-01-03
aolishuai 2019-12-25
大白配小猪 2019-11-12
yongzhang 2019-10-25
单调的低调 2019-09-09
fenghuoliuxing0 2019-09-07
CSDNMrWang 2011-06-13
chumeng 2011-06-04
daidaizhuzhu 2011-05-28
loveyy 2013-08-10
xxuyuan 2011-03-22
yanghan 2012-12-27
大伟爱自由 2010-04-21