worker_processes 1;

events {
  worker_connections 1024;
}

http{
  sendfile on;

  server {
    listen 8820;

    location /upload_files {
      root                /www;
      autoindex           off;
      sendfile_max_chunk  200k;
    }

    location / {
      proxy_pass_header  Set-Cookie;
      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-Host $server_name;
      proxy_pass      http://frontend:3000;
      proxy_redirect  off;
    }

    location /graphql {
      proxy_pass_header  Set-Cookie;
      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-Host $server_name;
      proxy_pass      http://backend:4000/graphql;
      proxy_redirect  off;
      client_max_body_size	100m;
    }
  }
}
