server { listen 80; listen [::]:80; server_name localhost cdn.dev.d4science.org cdn.cloud-dev.d4science.org cdn.cloud.d4science.org cdn.d4science.org; #error_log /var/log/nginx/localhost.error_log debug; root /var/www/html; #access_log /var/log/nginx/host.access.log main; location / { if ($request_method = 'OPTIONS') { add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, HEAD, OPTIONS'; add_header Content-Type text/plain; add_header Access-Control-Allow-Headers "Content-Type, Authorization, Accept, Origin, Location"; add_header Content-Length 0; add_header Access-Control-Allow-Private-Network true; return 204; } try_files $uri /head$uri =404; } location /health { return 200; } location /api/update/ { proxy_pass http://localhost:8000; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }