https访问http的minio 图片展示不出来

问题描述:请求到的图片地址单独访问能显示,但是在网页中展示不出来

原因:https中直接访问http是不行的,需要用nginx再转发一下

nginx配置如下(注意:9000是minio默认端口,已经占用,所以这里监听9001

bash 复制代码
	server {
		listen    9001 ssl;
		server_name 172.19.129.9;
		
		ssl_certificate localhost.pem;
        ssl_certificate_key localhost-key.pem;
		
		location /defect/ {
		   proxy_pass http://172.19.129.9:9000/defect/;
		   proxy_set_header  Host       $host;
		   proxy_set_header  X-Real-IP    $remote_addr;
		   proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
		}
		
	}

Redis中存minio上传成功的url也是要替换http为https的,端口9000也要替换为9001

bash 复制代码
        String imgUrl = FileUploadUtils.uploadMinio(img);
        imgUrl = imgUrl.replace("localhost","172.19.129.9");
        imgUrl = imgUrl.replace("http","https");
        imgUrl = imgUrl.replace("9000","9001");
相关推荐
DongHao14 小时前
我不想一开始就把 Axios 封装的太完美
前端·http·axios
qq_4112624214 小时前
在建立udp连接的时候,有时候能成功,有时候AT 指令返回+ERRNO:0x70
网络·网络协议·udp
小江的记录本16 小时前
【TCP】TCP三次握手与四次挥手(系统性知识体系+对比表格)
java·服务器·网络·网络协议·tcp/ip·http·tcp
高梦轩16 小时前
Nginx 安全防护与 HTTPS 部署实战文档
nginx·安全·https
Vect__16 小时前
深刻理解HTTP
网络·网络协议·http
生活很暖很治愈17 小时前
Linux——HTTP协议
linux·服务器·c++·网络协议·ubuntu·http
自在极意功。17 小时前
TCP三次握手与四次挥手
网络·网络协议·tcp/ip·计算机网络·三次握手·四次挥手
小江的记录本18 小时前
【HTTP】HTTP请求方法与状态码(全体系知识总结+附表格)
前端·网络·后端·网络协议·http·状态模式·web
萝卜白菜。18 小时前
http头键名大小写问题
网络·网络协议·http
2501_9159184118 小时前
通过IPA 结构调整和资源指纹变化来处理 iOS 应用相似度问题
android·ios·小程序·https·uni-app·iphone·webview