How do I setup reverse proxy on nginx to avoid the CORS issue for my ionic and meanjs application.
<p>So I have 2 apps running on same server. 
1. On backend I have Mean.js which provides the services to perform CRUD operations. 
2. On front end I'm using IONIC app which provides the UI experience. </p>

<p>Front end ( Ionic app )  is running on 81 and Backend on 3000. </p>

<p>I tried to setup reverse proxy for backend ( node/ mean ) by looking up online but didnt succeed. </p>

<p>Here's my nginx setup </p>

<pre><code>server {
    listen 80;

    server_name meantodo.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
} 
</code></pre>

<p><a href="https://i.stack.imgur.com/Bum6Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bum6Q.png" alt="enter image description here"></a></p>