Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active May 19, 2020 17:35
Show Gist options
  • Save juanpablocs/6a5f1358ce8d11373eb3ed07cba713d7 to your computer and use it in GitHub Desktop.
Save juanpablocs/6a5f1358ce8d11373eb3ed07cba713d7 to your computer and use it in GitHub Desktop.
How to configure nginx site with cors and proxy_pass

Nginx config

server {
    listen 80;
    server_name site.dev;
    add_header 'Access-Control-Allow-Credentials' 'true';
    location /  {
       proxy_pass http://127.0.0.1:3001/;
    }
}

consideration: nots neccesary add "Access-Control-Allow-Origin" "*" and 204 Option if app have a cors activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment