<p>I have a kubernetes cluster with several services deployed in it, now my angular app is trying to connect to the microservice through the network load balancer url connected to ingress, now in the CORS annotation i want to specify a set of domains who can access the services</p>
<p>I have a admin portal angular app and user portal angular app, both have different domains , both want to connect to the service in the kubernetes cluster.</p>
<p>Suppose how could we specify <code>www.angular1.com and www.angular2.com</code> in the ingress cors annotation</p>
<p>Right now my configuration allows all origins,</p>
<pre><code>nginx.ingress.kubernetes.io/cors-allow-origin: &quot;*&quot;
</code></pre>
<p>Now i want to specify something like</p>
<pre><code>nginx.ingress.kubernetes.io/cors-allow-origin: www.angular1.com,www.angular2.com
</code></pre>
<p>What is the proper standard.</p>

George Thomas
<blockquote>
<p>nginx.ingress.kubernetes.io/cors-allow-origin: Controls what's the accepted Origin for CORS.</p>
<p>This is a single field value</p>
<p>kubernetes.github.io - <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#enable-cors" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#enable-cors</a></p>
</blockquote>
<p>There is a GitHub issue open requesting support for this feature: <a href="https://github.com/kubernetes/ingress-nginx/issues/5496" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/5496</a></p>
<p>You can see some users in the issue have used <code>nginx.ingress.kubernetes.io/configuration-snippet</code> to configure cors like you would in a nginx config file.</p>
<p>If you have control of the cluster, you could also consider changing ingress controllers. Emissary-ingress and Traefik are two I know of that support multiple origins, I'm sure there are others as well.</p>
