网络协议 https访问http的minio 图片展示不出来 - uploadMinio(img)

📅 2026-11-30 👤 拼多多助力营销技巧 📂 拼多多助力2027 👁️ 307 次阅读

问题描述:请求到的图片地址单独访问能显示,但是在网页中展示不出来 原因:https中直接访问http是不行的,需要用nginx再转发一下 nginx配置如下(注意:9000是minio默认端口,已经占用,所以这里监听9001)

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

String imgUrl = FileUploadUtils.uploadMinio(img);

imgUrl = imgUrl.replace("localhost","172.19.129.9");

imgUrl = imgUrl.replace("http","https");

imgUrl = imgUrl.replace("9000","9001");

相关阅读

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧