Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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