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");
相关推荐
8125035331 天前
第13篇:TCP vs UDP——可靠与速度的博弈
网络协议·tcp/ip·udp
乐兮创想 小林1 天前
企业官网的安全架构:从 HTTPS、WAF 到备份与应急响应的 7 层防御工程
安全·https·网站建设·安全架构·企业官网·北京网站建设公司
代码中介商1 天前
HTTP 完全指南(最终篇):CORS 跨域资源共享深度详解
网络·网络协议·http
user73263921004781 天前
借助AI再次理解三次握手和四次挥手
网络协议·面试
abcefg_h1 天前
HTTP 协议版本演进:从 TCP 连接到 QUIC
网络·网络协议·http
liulilittle1 天前
拥塞控制:公平性的不可能三角
网络·c++·网络协议·tcp/ip·计算机网络·tcp·通信
8125035331 天前
第 8 篇:IP 地址:互联网的门牌号
网络·网络协议·tcp/ip
日取其半万世不竭1 天前
low-memory-server-swap-20260601
docker·容器·https
米丘1 天前
HTTP 关于 HTTPS SSL/TLS 、 HTTP/2 特性
网络协议·https
KaMeidebaby1 天前
卡梅德生物技术快报|细胞周期检测抗原流式分析:参数调试、软件拟合与问题排查
网络·人工智能·python·网络协议·tcp/ip·算法·机器学习