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");
相关推荐
00后程序员张37 分钟前
iOS 应用上架常见问题与解决方案,多工具组合的实战经验
android·ios·小程序·https·uni-app·iphone·webview
rainFFrain15 小时前
Boost搜索引擎项目(详细思路版)
网络·c++·http·搜索引擎
2501_9160074716 小时前
iOS App 上架实战 从内测到应用商店发布的全周期流程解析
android·ios·小程序·https·uni-app·iphone·webview
.Shu.16 小时前
计算机网络 HTTPS 全流程
网络协议·计算机网络·https
还听珊瑚海吗20 小时前
基于WebSocket和SpringBoot聊天项目ChatterBox测试报告
spring boot·websocket·网络协议
猿究院--冯磊1 天前
计算机网络--HTTP协议
网络协议·计算机网络·http
元清加油1 天前
【Goland】:协程和通道
服务器·开发语言·后端·网络协议·golang
让代码飞~1 天前
idea进阶技能掌握, 使用自带HTTP测试工具,完全可替代PostMan
java·http·intellij-idea·postman
iナナ2 天前
传输层协议——UDP和TCP
网络·网络协议·tcp/ip·udp
舒一笑2 天前
Mac 上安装并使用 frpc(FRP 内网穿透客户端)指南
后端·网络协议·程序员