<p>I'm facing the following error while running Node.js WEB app on IBM Cloud Kubernetes with AppId:
The WEB app is accessed via ingress URL: <code>https://&lt;host url&gt;/ar-studio</code></p>
<p><strong>ar-studio</strong> is the backend service path as is configured in ingress.
index.html has the following HTML line</p>
<pre><code>&lt;div class=&quot;button&quot;&gt;&lt;a id=&quot;signin&quot; href=&quot;protected/protected.html&quot; title=&quot;Sign In to service&quot;&gt;Sign In to service&lt;/a&gt;&lt;/div&gt;
</code></pre>
<ol>
<li>User clicks on the Sign In link and IBM AppId login widget is displayed with the correct redirect uri.</li>
<li>User successfully logs in (using cloud directory), and the client page is redirected to     <code>https://&lt;host url&gt;/protected/protected.html</code> instead of using the service root path <code>https://&lt;host url&gt;/ar-studio/protected/protected.html</code></li>
</ol>
<p>How can I fix it so the browser will be redirected to <code>https://&lt;host url&gt;/ar-studio/protected/protected.html</code> ?
The app works great without ingress, on my local docker engine.
Here are the relevant ingress yaml fields (some values replaced with <code>...</code> for security reasons):</p>
<pre><code>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: &quot;True&quot;
  creationTimestamp: &quot;...&quot;
  generation: 20
  name: ...
  namespace: ...
  resourceVersion: &quot;...&quot;
  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: ...
</code></pre>

Orit
<p>I imagine you'd need to add the bluemix annotation for App ID to your ingress resource, <code>ingress.bluemix.net/appid-auth</code> - instructions at <a href="https://cloud.ibm.com/docs/containers?topic=containers-ingress_annotation#appid-auth" rel="nofollow noreferrer">https://cloud.ibm.com/docs/containers?topic=containers-ingress_annotation#appid-auth</a></p>
