0

在使用 AppId 在 IBM Cloud Kubernetes 上运行 Node.js WEB 应用程序时遇到以下错误:通过入口 URL 访问 WEB 应用程序:https://<host url>/ar-studio

ar-studio是在 ingress 中配置的后端服务路径。index.html 具有以下 HTML 行

<div class="button"><a id="signin" href="protected/protected.html" title="Sign In to service">Sign In to service</a></div>
  1. 用户单击登录链接,IBM AppId 登录小部件将显示正确的重定向 uri。
  2. 用户成功登录(使用云目录),客户端页面被重定向到 https://<host url>/protected/protected.html而不是使用服务根路径https://<host url>/ar-studio/protected/protected.html

如何修复它以便将浏览器重定向到https://<host url>/ar-studio/protected/protected.html?该应用程序在我的本地 docker 引擎上运行良好,无需入口。...以下是相关的入口 yaml 字段(出于安全原因,一些值已替换为):

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.bluemix.net/client-max-body-size: size=400m;
    ingress.bluemix.net/rewrite-path: |
      serviceName=ar-studio rewrite=/;
    nginx.ingress.kubernetes.io/x-forwarded-prefix: "True"
  creationTimestamp: "..."
  generation: 20
  name: ...
  namespace: ...
  resourceVersion: "..."
  selfLink: ...
  uid: ...
spec:
  rules:
  - host: dev.cvar.eu-gb.containers.appdomain.cloud
    http:
      paths:
      - backend:
          serviceName: ar-studio
          servicePort: http
        path: /ar-studio/
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - dev.cvar.eu-gb.containers.appdomain.cloud
    secretName: ...
status:
  loadBalancer:
    ingress:
    - ip: ...
4

1 回答 1

1

我想您需要将 App ID 的 bluemix 注释添加到您的入口资源中ingress.bluemix.net/appid-auth- https://cloud.ibm.com/docs/containers?topic=containers-ingress_annotation#appid-auth上的说明

于 2020-10-06T14:06:11.780 回答