summaryrefslogtreecommitdiffstats
path: root/docker/storperf-httpfrontend/nginx.conf
blob: 7f3ddd7aa329da51fe36549421f1b5033089c608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
http {
    include            mime.types;
    default_type       application/octet-stream;
    sendfile           on;
    keepalive_timeout  65;
    proxy_send_timeout 600;
    proxy_read_timeout 600;
    send_timeout       600;

    map $args $containsurl {
        default 0;
        "~(^|&)url=[^&]+($|&)" 1;
    }

    server {
        listen 5000;

        location /api/ {
            proxy_pass http://storperf-master:5000;
            proxy_set_header Host $host:$proxy_port;
        }

        location /graphite/ {
            proxy_pass http://storperf-graphite:8080;
            proxy_set_header Host $host:$proxy_port;
        }

        location /reporting/ {
            proxy_pass http://storperf-reporting:5000;
            proxy_set_header Host $host:$proxy_port;
        }

        location /swagger/ {
            if ($containsurl = 0) {
                return 302 $scheme://$host:$server_port$uri?url=http://$host:$server_port/api/spec.json$args;
            }
            proxy_pass http://storperf-swaggerui:80/;
        }
    }
}

events {
    worker_connections 1024;
}