|
server { |
|
listen 80; |
|
listen [::]:80; |
|
server_name localhost; |
|
|
|
location / { |
|
root /usr/share/nginx/html; |
|
index index.html index.htm; |
|
|
|
|
|
try_files $uri $uri/ =404; |
|
|
|
|
|
gzip on; |
|
gzip_types application/json text/tab-separated-values; |
|
gzip_min_length 1000; |
|
gzip_vary on; |
|
|
|
|
|
default_type application/json; |
|
types { |
|
application/json json; |
|
text/tab-separated-values tsv; |
|
} |
|
|
|
|
|
add_header 'Access-Control-Allow-Origin' 'https://spinup-0028ce.spinup.yale.edu' always; |
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; |
|
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization'; |
|
add_header 'Access-Control-Allow-Credentials' 'true' always; |
|
add_header 'Access-Control-Expose-Headers' 'Content-Range' always; |
|
|
|
|
|
if ($request_method = OPTIONS) { |
|
add_header 'Access-Control-Allow-Origin' 'https://spinup-0028ce.spinup.yale.edu'; |
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; |
|
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization'; |
|
add_header 'Access-Control-Allow-Credentials' 'true'; |
|
add_header 'Access-Control-Expose-Headers' 'Content-Range'; |
|
return 204; |
|
} |
|
} |
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html; |
|
location = /50x.html { |
|
root /usr/share/nginx/html; |
|
} |
|
} |
|
|
|
|