其他分享
首页 > 其他分享> > spring整合OSS使用STS方式前端上传回调签名校验失败

spring整合OSS使用STS方式前端上传回调签名校验失败

作者:互联网

因公司使用nginx反向代理至后端,其中配置

location /prod-api/
{
    proxy_pass http://127.0.0.1:39170/;
    proxy_set_header Host $host;
    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;
    
    add_header X-Cache $upstream_cache_status;
	#Set Nginx Cache
	proxy_ignore_headers Set-Cookie Cache-Control expires;
	add_header Cache-Control no-cache;
    expires 12h;
}

此时oss回调签名校验失败。

解决方式:

location /
{
    proxy_pass http://127.0.0.1:39170/;
    proxy_set_header Host $host;
    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;
    
    add_header X-Cache $upstream_cache_status;
	#Set Nginx Cache
	proxy_ignore_headers Set-Cookie Cache-Control expires;
	add_header Cache-Control no-cache;
    expires 12h;
}

原因暂未深究,等有时间吧。

标签:set,spring,OSS,Cache,header,add,proxy,STS,39170
来源: https://blog.csdn.net/qq_42017523/article/details/120783331