location / {
#阿里云OSS Bucket 域名
proxy_pass https://*********.aliyuncs.com;
proxy_set_header Host *********.aliyuncs.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
#proxy_hide_header Upgrade;
#如果不加这个图片会变成下载而不是直接显示
proxy_hide_header "Content-Disposition";
add_header "Content-Disposition" "inline;";
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileIOVLazrh 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileIOVLazrh 1;
expires 1m;
}
if ( $static_fileIOVLazrh = 0 )
{
add_header Cache-Control no-cache;
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号