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");
相关推荐
guts°9 分钟前
10-ACL技术
网络·网络协议
群联云防护小杜19 分钟前
深度隐匿源IP:高防+群联AI云防护防绕过实战
运维·服务器·前端·网络·人工智能·网络协议·tcp/ip
en-route39 分钟前
Http请求中的特殊字符
spring·http
2301_780789665 小时前
UDP和TCP的主要区别是什么
服务器·网络协议·web安全·网络安全·udp
有书Show10 小时前
个人IP的塑造方向有哪些?
网络·网络协议·tcp/ip
游戏开发爱好者811 小时前
iOS App 电池消耗管理与优化 提升用户体验的完整指南
android·ios·小程序·https·uni-app·iphone·webview
代码搬运媛11 小时前
HTTP REST API、WebSocket、 gRPC 和 GraphQL 应用场景和底层实现
websocket·http·graphql
不认输的西瓜17 小时前
前端网络知识——HTTP和HTTPS
http·https
DoraBigHead17 小时前
应用层:万维网的魔法门,协议的隐秘契约
网络协议
Jiude17 小时前
如何使用 Certbot 为域名配置永久免费的 HTTPS 证书
后端·nginx·https