summaryrefslogtreecommitdiffstats
path: root/docker/nginx/sites-available/default-onap
blob: e6aecb1150f4e13965b58bdb59c286b6aca0ecc3 (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
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 ~* /onap-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/onap/results/upload {
        client_max_body_size 20m;
        proxy_pass http://lfnapi/api/v1/onap/results/upload;
        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/onap-ui;
        expires 1d;
    }

    error_page 413 =200 /413.json;

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

}