server {
    listen 80;
    server_name 192.168.1.121;
    location / {
        proxy_hide_header 'Access-Control-Allow-Origin';
        add_header 'Access-Control-Allow-Origin' '*' always;

        proxy_hide_header 'Access-Control-Allow-Headers';
        add_header 'Access-Control-Allow-Headers' '*' always;

        proxy_hide_header 'Access-Control-Allow-Methods';
        add_header 'Access-Control-Allow-Methods' '*' always;

        proxy_pass http://react:3000/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache off;
    }
    location /api/ {
        proxy_hide_header 'Access-Control-Allow-Origin';
        add_header 'Access-Control-Allow-Origin' '*' always;

        proxy_hide_header 'Access-Control-Allow-Headers';
        add_header 'Access-Control-Allow-Headers' '*' always;

        proxy_hide_header 'Access-Control-Allow-Methods';
        add_header 'Access-Control-Allow-Methods' '*' always;

        proxy_pass http://api:8000/api/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache off;
    }
}
