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");
相关推荐
KAI丶8 小时前
【Https】Received fatal alert: internal_error
https·1024程序员节
jfqqqqq9 小时前
使用pem和key文件给springboot开启https服务
网络协议·http·https
Tony Bai11 小时前
【Go 网络编程全解】13 从 HTTP/1.1 到 gRPC:Web API 与微服务的演进
开发语言·网络·http·微服务·golang
易ლ拉罐13 小时前
【计算机网络】HTTP协议(二)——超文本传输协议
网络·计算机网络·http·1024程序员节
LCMICRO-1331084774614 小时前
长芯微LDUM3160完全P2P替代ADUM3160,LDUM3160是一款采用ADI公司iCoupler® 技术的USB端口隔离器
网络·stm32·单片机·嵌入式硬件·网络协议·fpga开发·硬件工程
Fms_Sa18 小时前
UDP实现客服与客户的咨询对话
网络·网络协议·udp
BIBI204919 小时前
HTTP 请求方法指南:GET, POST, PUT, PATCH, DELETE 区别
网络·网络协议·http
代码不停19 小时前
网络 UDP 和 TCP / IP详细介绍
网络·网络协议·tcp/ip·udp·1024程序员节
fenglllle21 小时前
http trailer 与 http2
http·wireshark·1024程序员节
2501_9159184121 小时前
iOS 26 查看电池容量与健康状态 多工具组合的工程实践
android·ios·小程序·https·uni-app·iphone·webview