一、nginx解决跨域问题
server {
listen 80;
server_name www.yang.com;
location /A {
proxy_pass http://a.a.com:81/A;
index index.html index.htm;
}
location /B {
proxy_pass http://b.b.com:81/B;
index index.html index.htm;
}
}
二、nginx配置防盗链
location ~ .*\.(jpg|jpeg|JPG|png|gif|icon)$ {
valid_referers blocked http://www.yang.com www.yang.com;
if ($invalid_referer) {
return 403;
}
}