BladeX Docker部署 Saber无法正常使用

Blade 未结 2 1866
brucedong
brucedong 2020-10-06 12:26

一、该问题的重现步骤是什么?

   0.使用bladex/script/docker/app/deploy.sh 部署,部署过程中发现无法获取harbor镜像,修改docker-compose.yaml中的image地址后,并重新制作report,成功启动所有docker,其他未作调整:

image.png

  1. Saber项目直接使用yarn build 生成 dist文件;

  2. 上传dist下所有文件至 docker app_web-nginx_1 /usr/share/nginx/html/目录:

image.png

3.浏览器访问 http://192.168.1.102:8000,出现未知错误:

image.png

4.F12调试发现500错误:


  1. Request URL:
    http://192.168.1.102:8000/api/blade-auth/oauth/captcha
    Request Method:
    GET
    Status Code:
    500 Internal Server Error

    响应文本:

  2. {"code":500,"data":null,"message":"Failed to handle request [GET http://192.168.1.102/blade-auth/oauth/captcha]: finishConnect(..) failed: Connection refused: /172.30.0.91:8100"}

5.WEB-NGINX配置文件如下:

/ # cat /etc/nginx/nginx.conf 
user  root;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  65;
    #gzip  on;
    #include /etc/nginx/conf.d/*.conf;
    upstream gateway {
                 server 172.30.0.81;
                 server 172.30.0.82;
                 server 172.30.0.83;
             }
    server {
      listen       8000;
      server_name  web;
      root         /usr/share/nginx/html;
      location / {
      }
      location ^~ /oauth/redirect {
           rewrite ^(.*)$ /index.html break;
      }
      location ^~ /api {
           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_buffering off;
           rewrite ^/api/(.*)$ /$1 break;
           proxy_pass http://gateway;
      }
    }
}
/ # 


二、你期待的结果是什么?实际看到的又是什么?

正常登录,实际api调用500错误


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

BladeX/最新版/CentOS7/Docker 19


四、请提供详细的错误堆栈信息,这很重要。

浏览器报错,消息如上


五、若有更多详细信息,请在下面提供。

2条回答
代码语言
提交回复