Skip to content

Instantly share code, notes, and snippets.

@blackbing
Created December 4, 2015 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackbing/ba13e03d72c2cc848d2c to your computer and use it in GitHub Desktop.
Save blackbing/ba13e03d72c2cc848d2c to your computer and use it in GitHub Desktop.
nginx proxy data-taipei
server {
server_name data-taipei.blackbing.net;
listen 80;
location / {
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
proxy_pass http://data.taipei/;
}
if ($request_method = 'OPTIONS') {
return 204;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment