Appearance
nginx
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.rainx.top;
location / {
proxy_pass http://192.168.44.102;
}
location ~*/(js|css|img) {
# 防盗链
# 合法的 referer
valid_referers none 192.168.44.101 www.rainx.top;
if ($invalid_referer) {
# 如果是无效的 referer
# 图片盗链,给出图片错误的提示。
rewrite ^/ /img/error.png break;
# 网站盗链,给出页面错误的提示。
# 存在有问题,并没有显示错误页面。
# return 403;
}
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
error_page 403 /403.html;
location = /403.html {
root html;
}
}
}