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}'; } }