fix: 修复客户度右键复制图片失败的情况

This commit is contained in:
kuaifan 2025-07-18 13:20:08 +08:00
parent a19cf0e1c3
commit 9633f7644e

View File

@ -38,6 +38,26 @@ server {
try_files $uri @laravels;
}
location ~* \.(jpe?g|png|gif|webp|svg|ico|bmp)$ {
add_header Access-Control-Allow-Origin "http://localhost:2222" always;
add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always;
add_header Access-Control-Allow-Credentials "true" always;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin "http://localhost:2222";
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization";
add_header Access-Control-Allow-Credentials "true";
add_header Access-Control-Max-Age 1728000;
add_header Content-Type "text/plain; charset=utf-8";
add_header Content-Length 0;
return 204;
}
try_files $uri @laravels;
}
location ~ \.well-known{
allow all;
}