|      1Chaidu      213 天前  5 你根本不知道 CORS 是什么意思! | 
|      2Chaidu      213 天前 以后有问题去问 AI 就行,不要发帖。问题:Nginx 防盗链 | 
|      3wu00      213 天前 Access-Control-Allow-Origin | 
|  |      4wzhaoyang      213 天前  1 img 、js  不存在跨域 | 
|  |      5zx9481      213 天前  1 location /images/ { valid_referers none blocked www.yourdomain.com yourdomain.com; if ($invalid_referer) { return 403; # 返回 403 Forbidden 错误 # 或者可以重定向到特定的图片或页面 # return 302 http://www.yourdomain.com/blocked.png; } } | 
|      6paopjian      213 天前 没啥用, 想用你的东西再不行拿反代拉, 你资源真重要就得走登录控制 | 
|      8hackroad      212 天前  1 # # Wide-open CORS config for nginx # location / { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; # # Custom headers and headers various browsers *should* be OK with but aren't # add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; # # Tell client that this pre-flight info is valid for 20 days # add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain; charset=utf-8'; add_header 'Content-Length' 0; return 204; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; } if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; } } | 
|  |      9lisongeee      212 天前  1 把账号密码私钥给我,我开 ssh 上去免费给你弄 | 
|  |      10wangtian2020      212 天前  3 跨域是指,接口没带 CORS 跨域返回头,你的浏览器认为自己不配访问。postman 调用接口是能拿到东西的。 防盗链是指,NGINX 觉得对方的请求头有问题不配拿到任何东西。 | 
|  |      12daimaosix      212 天前 via Android 开 ssh 我上去看看 | 
|  |      13EthZhang      212 天前 跨域是针对浏览器的名词,只存在于浏览器,正如上面老哥说的,防盗链一行命令就能加,后端程序里现在也有 CORS 插件很方便就能引入。但也仅仅局限于浏览器, |