-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
31 lines (26 loc) · 1023 Bytes
/
nginx.conf
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
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
location /bigg/ {
# Handle CORS preflight
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# Allow the Authorization header (which we must strip out below)
add_header 'Access-Control-Allow-Headers' 'Authorization';
# Return immediately - do not pass the request to bigg
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
proxy_pass http://bigg.ucsd.edu/api/v2/;
proxy_set_header Authorization "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
}