server {
    listen 8001;
    server_name _;
    root /usr/share/nginx/html;
    index app.html;

    location /api/ {
        proxy_pass http://api:8000/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /download/ {
        alias /usr/share/nginx/html/download/;
        add_header Content-Disposition "attachment";
        autoindex off;
    }

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

    gzip on;
    gzip_types text/html text/css application/javascript;
}
