upstream django {
    server web:8000;
}

server {
    listen 80;
    server_name localhost 127.0.0.1;

    client_max_body_size 10M;

    location /static/ {
        alias /app/staticfiles/;
        expires 30d;
        access_log off;
    }

    location /media/careers/cvs/ {
        deny all;
        return 404;
    }

    location /media/ {
        alias /app/media/;
        expires 7d;
        access_log off;
    }

    location / {
        proxy_pass         http://django;
        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_redirect     off;
        proxy_read_timeout 60s;
    }
}
