fatiharaci / spotweety

spotweety.club - a twitter analyzer for spotify
http://spotweety.club/
0 stars 0 forks source link

Prod Deployment CORS Issue #21

Closed fatiharaci closed 7 years ago

fatiharaci commented 7 years ago

image

Sending request to backend with localhost causing this issue

fatiharaci commented 7 years ago

https://www.flickr.com/photos/iluvrhinestones/5889370258/

fatiharaci commented 7 years ago

thanks to Arda Oğulcan; this problem solved by updating nginx

/etc/nginx/sites-enabled

server {
    listen 80;

    server_name spotweety.club www.spotweety.club;

    location /api {
        rewrite ^/api/(.*) /$1 break;
        proxy_pass http://localhost:8000;
        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;
    }

    location / {
        root /home/faraci/repos/Spring2017Swe573/SpoTweetyMaster/static;
        index index.html;
    }
}