upstream UseVoice {
    server web:8000;
}

upstream celery_flower {
    server flower:5555;
}

server {
    listen 80;
    location / {
        proxy_pass http://UseVoice;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
        # client_max_body_size 100M;
        client_body_buffer_size     20M;
        client_max_body_size        20M;

        add_header Access-Control-Allow-Origin *;
    }
    
    location /static/ {
        alias /home/app/web/static/;
        add_header Access-Control-Allow-Origin *;
    }

    location /media/ {
        alias /home/app/web/media/;
        add_header Access-Control-Allow-Origin *;
    }
}

server {
    listen 5555;
    location / {
        proxy_pass http://celery_flower;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
}

