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");
相关推荐
码里法3 小时前
centos安装nginx并配置https完整版
nginx·https·centos
_F_y4 小时前
Socket编程TCP
网络·网络协议·tcp/ip
一线大码5 小时前
安全保护协议 SSL 和 TLS 的区别
后端·http
曹天骄5 小时前
OSS 传输加速 与 CDN 的区别
运维·阿里云·https
游戏开发爱好者85 小时前
抓包工具有哪些?代理抓包、数据流抓包、拦截转发工具
android·ios·小程序·https·uni-app·iphone·webview
Wang's Blog7 小时前
Kafka: HTTPS证书申请集成指南
分布式·https·kafka
Lucifer三思而后行7 小时前
看来 Oracle 还是听劝的!
http
蜜獾云7 小时前
charles抓包原理
服务器·https·ssl
刺客xs8 小时前
TCP网络通信
网络·网络协议·tcp/ip
爬山算法8 小时前
Netty(26)如何实现基于Netty的RPC框架?
网络·网络协议·rpc