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");
相关推荐
extrao9 小时前
🚀 Kea DHCP4 自动分配系统完整搭建
网络协议
喵个咪12 小时前
Go-Wind HTTP 服务器从入门到精通
后端·http·go
不做菜鸟的网工2 天前
BGP特性
网络协议
AlfredZhao2 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80
明月_清风4 天前
开发者网络概念全扫盲:一篇搞定
后端·网络协议
刘马想放假4 天前
Modbus 全栈技术解析:TCP、RTU、ASCII、RTU over TCP
数据结构·网络协议
王二端茶倒水6 天前
一套可落地的无线运营方案,不能只管 AP,还要管用户、计费和运维
网络协议
162723816086 天前
EtherCAT 分布式时钟(DC)原理与配置实战:把多轴真正"对齐到同一时刻"
网络协议
王二端茶倒水6 天前
宽带无线项目,怎么从一次性交付变成长期运营收入?
网络协议
Goodbye6 天前
大模型无状态架构:从 HTTP 协议到 Harness AI 工程的深度解析
http