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");
相关推荐
韭菜炒大葱1 天前
前端经典面试题:从 URL 输入到页面展示,中间经历了什么?
前端·http·面试
Sheffield2 天前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
小时前端6 天前
HTTPS 页面加载 HTTP 脚本被拦?同源代理来救场
前端·https
YuMiao6 天前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
不可能的是7 天前
前端 SSE 流式请求三种实现方案全解析
前端·http
Jony_9 天前
高可用移动网络连接
网络协议
chilix9 天前
Linux 跨网段路由转发配置
网络协议
gihigo199811 天前
基于TCP协议实现视频采集与通信
网络协议·tcp/ip·音视频
古译汉书11 天前
【IoT死磕系列】Day 7:只传8字节怎么控机械臂?学习工业控制 CANopen 的“对象字典”(附企业级源码)
数据结构·stm32·物联网·http
白太岁11 天前
通信:(5) 电路交换、报文交换与分组交换
运维·服务器·网络·网络协议