upstream test {
    zone test 64k;
}

proxy_cache_path /var/cache/nginx keys_zone=http_cache:10m max_size=100m;
limit_req_zone $binary_remote_addr zone=one:10m rate=1500r/s;
limit_conn_zone $binary_remote_addr zone=addr:10m;

server {
    listen 8080;

    limit_req zone=one burst=100;
    limit_conn addr 10;

    location = /dashboard.html {
        root /usr/share/nginx/html;
    }

    location /api {
        status_zone location_test;
        api write=on;
    }

    location /test {
        proxy_pass http://test;
        proxy_cache http_cache;
        health_check interval=10 fails=3 passes=1;
    }
    status_zone test;

}

upstream test-drain {
    zone test-drain 64k;

    server 127.0.0.1:9001 drain;
}
