summaryrefslogtreecommitdiffstats
path: root/docker/nginx/sites-available/default-opnfv
blob: f271fb4c38a52c6a8e57c1a70650a1a5847341a3 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
upstream lfnapi {
    server lfnapi:8010;
}

server {
    listen 8000 default_server;
    listen [::]:8000 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    server_name localhost;

    location ~* /testapi-ui/ {
        root /www/static;
        expires 1d;
    }

    location ~* /logs/.*\.(log|out|yaml|yml|txt|conf|json|sh|)$ {
        root /home/testapi;
        add_header Content-Type text/plain;
    }

    location ~* /logs/.*/results {
        root /home/testapi;
        expires 1d;
        autoindex on;
        autoindex_exact_size off;
        autoindex_localtime on;
    }

    location ~* /logs/api {
        root /home/testapi;
        expires 1d;
        autoindex on;
        autoindex_exact_size on;
        autoindex_localtime on;
    }

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

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

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

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

    location = /api/v1/results {
        proxy_pass http://lfnapi/api/v1/results;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
    }

    location ~* /api/v1/results/([a-zA-Z0-9]+) {
        client_max_body_size 20m;
        proxy_pass http://lfnapi/api/v1/results/$1;
        proxy_set_header X-Real_IP $remote_addr;
        proxy_set_header Host $host;
    }

    location ~* /api/v1/suts/hardware/([a-zA-Z0-9\-]+) {
        proxy_pass http://lfnapi/api/v1/suts/hardware/$1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
    }

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

    location / {
        root /www/static/testapi-ui;
        expires 1d;
    }

    error_page 413 =200 /413.json;

    location /413.json {
        return 200 '{"msg": "Please upload a file less than 20MB.", "code": 413}';
    }

}