JimuReport icon indicating copy to clipboard operation
JimuReport copied to clipboard

1.8版本配置https后,在仪表盘中有几个接口请求的路径还是http,导致请求混用

Open gitchenming opened this issue 1 year ago • 2 comments

版本号:

1.8

问题描述:

1.8版本配置https后,在仪表盘中有几个接口请求的路径还是http,导致请求混用

错误日志&截图:

![1724896461099](https://github.com/user-attachments/assets/ab12fa99-f8ec-4854-ae1f-44779 1724896345767 c2b940c) 4bb521802b7568d47dbc851910b2c8a

重现步骤:

友情提示(为了提高issue处理效率):

  • 积木报表是一款免费报表产品,功能免费源码不开放;
  • 未按格式要求发帖,会被直接删掉;
  • 请针对问题提供[报表设计配置或SQL脚本]或在官网制作报表示例并提供ID;
  • 针对不好重现的问题,请录制操作视频或详细的重现步骤;

gitchenming avatar Aug 29 '24 07:08 gitchenming

南方小火人

gitchenming avatar Aug 29 '24 07:08 gitchenming

着急帮忙看下

gitchenming avatar Aug 29 '24 10:08 gitchenming

参考修改nginx配置: https://blog.csdn.net/weixin_34376986/article/details/89767950

lsqGitHub716 avatar Sep 05 '24 01:09 lsqGitHub716

改了下nginx的配置还是不行,nginx配置如下: 微信图片_20240905133156

仪表盘设计里面的组件还是出不来,如下图: 1725514279063 Uploading 1725514279063.jpg…

报表url是:https://xxxxx/drag/index?pageId=990784598098268160 仪表盘设计的时候左边的组件出不来,访问的地址是http的: http://xxxxx/drag/page/queryById?id=990784598098268160 http://xxxxx/drag/comp/treeList?excludeComp= http://xxxxx/drag/onlDragDatasetHead/getLoginUser http://xxxxx/drag/page/getCount

gitchenming avatar Sep 05 '24 05:09 gitchenming

你也没有配置 proxy_set_header X-Forwarded-Proto $scheme;呀

lsqGitHub716 avatar Sep 05 '24 05:09 lsqGitHub716

大佬,配置了也还是不行,帮忙看看,nginx配置如下: location /jmreport/ { proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://up_jmreport/jmreport/; }

  location /drag/ {
    proxy_set_header Host $host;
    proxy_set_header X-real-ip $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://up_jmreport/drag/;
  }

  location / {
     proxy_set_header Host $host;
     proxy_redirect  off;
     proxy_set_header X-real-ip $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto $scheme;
     proxy_set_header X-Scheme $scheme;
     proxy_pass http://up_jmreport;
  }

gitchenming avatar Sep 05 '24 09:09 gitchenming

是不是你前端是https的 后端是http的 导致,如果的是话,需要将后台也改成https

zhangdaiscott avatar Sep 06 '24 06:09 zhangdaiscott

不是的,我是用源码部署的积木报表,然后给他配置了https,去访问仪表盘设计器,设计的时候左边的组件列表出不来,看获取组件的接口是http的,不是https,是不是项目里面组件获取那块拿路径有点问题

gitchenming avatar Sep 06 '24 08:09 gitchenming

zhangdaiscott avatar Sep 06 '24 08:09 zhangdaiscott

就是用hppts访问积木报表的仪表盘的设计器,设计报表的时候左边的组件出不来: 仪表盘在线设计器报表url是:https://xxxxx/drag/index?pageId=990784598098268160 仪表盘在线设计器设计报表的时候左边的组件出不来,访问的地址是http的: http://xxxxx/drag/page/queryById?id=990784598098268160 http://xxxxx/drag/comp/treeList?excludeComp= http://xxxxx/drag/onlDragDatasetHead/getLoginUser http://xxxxx/drag/page/getCount

364636404-cd2363bf-2f51-4be3-be0c-68e0329ef3d3

F12看了下有4个接口访问的路径不是https,这4个接口应该也要是https的路径才对吧

gitchenming avatar Sep 06 '24 08:09 gitchenming

http://boot3.jeecg.com/dashboard/analysis 演示环境没问题

zhangdaiscott avatar Sep 06 '24 09:09 zhangdaiscott

用http的是没有问题,用https的才会有问题

gitchenming avatar Sep 06 '24 10:09 gitchenming

仪表盘访问地址就是https image

zhangdaiscott avatar Sep 06 '24 10:09 zhangdaiscott

你的配置 proxy_pass http://up_jmreport; getScheme()会取到http

image

nginx 配置下面两个选一个

配置X_GATEWAY_BASE_PATH 如: proxy_set_header X_GATEWAY_BASE_PATH /; (这样就会继承前端页面的host)

配置 X-Forwarded-Scheme 为https .
如下: proxy_set_header X-Forwarded-Scheme https;

改变的起始就是这里的domianURL image

YongYangLi avatar Sep 10 '24 05:09 YongYangLi

参考这个 image

zhangdaiscott avatar Sep 10 '24 06:09 zhangdaiscott