# CORS with NGINX Reverse Proxy

**URL:** <https://forums.suse.com/t/cors-with-nginx-reverse-proxy/20322>\
**Category:** General\
**Created:** [May 16, 2021, 2:16pm UTC](https://forums.suse.com/t/cors-with-nginx-reverse-proxy/20322 "2021-05-16T14:16:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unix3](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@unix3](https://forums.suse.com/u/unix3)\
**Post date:** [May 16, 2021, 2:16pm UTC](https://forums.suse.com/t/cors-with-nginx-reverse-proxy/20322/1 "2021-05-16T14:16:23Z")

</div>

Hi All,  
I have a VM with nginx installed and it manages the host `https://rancherproxy.vps.local.com`  
Moreover I have a cluster with Rancher reachable at `https://rancher.vps.local.com`  
What I want to obatin is to reach the Rancher cluster through the nginx.  
So I want to call `rancherproxy` and this call must be redirect to `rancher`.

I attached the nginx configuration

 ![proxy](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/7/7b1d1c3e821bf23b9eccbccbabe56326de4d95fb.jpeg)

At the same time I’ve customized the ingress rancher with this annotations:  
`nginx.ingress.kubernetes.io/cors-allow-credentials: "true"`  
`nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, PATCH, OPTIONS`  
`nginx.ingress.kubernetes.io/cors-allow-origin: rancherproxy`  
`nginx.ingress.kubernetes.io/enable-cors: "true"`

Now If I open my browser at `rancherproxy` URL I can see correctly the Rancher login page, but when I tried to put my credentials and click-on I stay stucked on the loging page.  
I tried to investigate the issue using the developer mode and I saw:

```
Request URL:
rancher..../v3-public/openLdapProviders/openldap?action=login

```

**Referrer Policy:**  
\*\* strict-origin-when-cross-origin\*\*

I don’t know why, I already set the CORS both on nginx and kubernetes ingress

What shoul I do?

Thanks  
Domenico
