diff options
author | Dan Xu <xudan16@huawei.com> | 2019-03-22 07:44:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-03-22 07:44:31 +0000 |
commit | aab171fe0b7b749a7414cc8d652b5f4662743106 (patch) | |
tree | 2108f5db2442bdbbd327ee80f2a17c9bf496d079 /docker/nginx/sites-available/default-opnfv | |
parent | 3b78fa2aeb6c69efb86c68ba5f6c7d7efccfb024 (diff) | |
parent | d0bbf3b8952379883550c6eb2062476a6d15043e (diff) |
Merge changes I36bbb6e6,I2f597763
* changes:
Enable Web Portal for ONAP results
Prepare Web Portal for ONAP integration
Diffstat (limited to 'docker/nginx/sites-available/default-opnfv')
-rw-r--r-- | docker/nginx/sites-available/default-opnfv | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/docker/nginx/sites-available/default-opnfv b/docker/nginx/sites-available/default-opnfv new file mode 100644 index 0000000..f271fb4 --- /dev/null +++ b/docker/nginx/sites-available/default-opnfv @@ -0,0 +1,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}'; + } + +} |