server {
    listen 3000;
    root /usr/share/nginx/html;
    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    }

    location /api {
        proxy_pass http://api:3001;
    }
    
    location ~ ^\/(uploads|unsubscribe|.well-known|(?:c$|c\/)|(?:o$|o\/)) { 
        rewrite ^\/(.*)$ /api/$1 break;
        proxy_pass http://api:3001;
    }

    client_max_body_size 64M;
}