server {
    listen 80;
    server_name _default;

    root /app;

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

    access_log /dev/stdout;
    error_log /dev/stderr warn;

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

    location ~* \.(css|js)$ {
        expires 30d;
        add_header Cache-Control "public";
    }

    location = /index.html {
        expires -1;
        add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
    }
}
