layout: post
title: nginx的重定向进行防盗链设置。
categories: GitHub
description: nginx防盗链。
对博客的保护,以及原创的文章图片进行防盗链设置。
测试url: http://firsh.me:8888/dockericon.png
code-nginx.conf
location ~* \.(gif|jpg|png|jpeg)$ {
expires 30d;
valid_referers *.firsh.me firsh.me;
if ($invalid_referer) {
rewrite ^/ http://firsh.me:8888/40x.html;
#return 404;
}
}