AWS KubeCloud 管理中心

前台部署

环境要求

  • nginx服务,(此处不赘述nginx安装,请自行网络查阅相关材料)

部署文件

  1. 从上一章节下载的部署中获取dist文件夹

部署步骤

  1. 将dist文件夹拷贝至任意目录下(例:/data,下面将用此目录描述)。
  2. nginx配置如下,127.0.0.1:8068为后台服务(根据后台部署实际IP和端口进行修改)

    server
        {
            listen 80;
            server_name 域名/外网IP;
            index index.html;
            root  /data/dist;  #dist上传的路径
    
            # 避免访问出现 404 错误
            location / {
              try_files $uri $uri/ @router;
              index  index.html;
            }
    
            location @router {
              rewrite ^.*$ /index.html last;
            }
    
            # 接口
            location /api {
              proxy_pass http://127.0.0.1:8068;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
            }
    
            # 授权接口
            location /auth {
              proxy_pass http://127.0.0.1:8068;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
            }
    
            # aws授权接口
            location /k8s-wrapper {
              proxy_pass http://127.0.0.1:8068;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
            }
    
            # WebSocket 服务
            location /webSocket {
              proxy_pass http://127.0.0.1:8068;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
            }
    
            # 头像
            location /avatar {
              proxy_pass http://127.0.0.1:8068;
            }
    
            # 文件
            location /file {
              proxy_pass http://127.0.0.1:8068;
            }
        }
    
  3. 启动nginx服务

  4. 访问

    在浏览器输入 http://127.0.0.1 , 默认账号为admin ,密码123456,如能正常访问表示启动成功。

管理中心控制台一般为企业内部运维人员使用,可不配置外网访问权限。



Seven
 010-62962343-690
 liujx@actionsoft.com.cn
感谢您对该文档的关注!如果您对当前页面内容有疑问或好的建议,请与我联系。如果您需要解答相关技术问题请登录AWS客户成功社区