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");
相关推荐
wljt1 小时前
HTTP和openFeign
网络·网络协议·http
bjxiaxueliang1 小时前
一文掌握SpringBoot:HTTP服务开发从入门到部署
spring boot·后端·http
汤愈韬8 小时前
ACL概述、ACL原理、基本ACL应用及配置
网络·网络协议·网络安全
haluhalu.14 小时前
Linux网络编程------网络基础
网络·网络协议
坐怀不乱杯魂14 小时前
Linux网络 - HTTP协议
网络·网络协议·http
ipooipoo118815 小时前
动态住宅IP的定义、核心优势与技术场景应用
网络·网络协议·tcp/ip
pythonchashaoyou18 小时前
静态住宅ip是什么,静态住宅IP选型全解
网络·网络协议·tcp/ip
REDcker19 小时前
HTTP请求数据包流转详解:localhost、127.0.0.1、公网 IP、公网域名访问时的数据流转
网络·tcp/ip·http
科技块儿1 天前
如何定期向监管部门报送IP属地统计报表?
网络·网络协议·tcp/ip
win x1 天前
UDP Socket
网络·网络协议·udp